Drupal force text to be markup
use Drupal\Core\Render\Markup;
$link_text = Markup::create('' . $title . '');
use Drupal\Core\Render\Markup;
$link_text = Markup::create('' . $title . '');
platform environment:activate new-feature
platform environment:list
+------+-------+--------+------------+
| ID | Title | Status | Type |
+------+-------+--------+------------+
| main | Main | Active | production |
+------+-------+--------+------------+
platform sql < my_database_backup.sql
or if can't determine current environment:
platform sql -e main < talktoyourdata.sql
platform db:dump --gzip
var email = document.querySelector('#edit-investor-profiles-0-entity-field-email-0-value').value;
if (email.length > 3) {
// construct an HTTP request
var xhr = new XMLHttpRequest();
var url = "/user/register/check-email"
xhr.open("POST", url, true);
xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
var data = JSON.stringify({"email": email});
// send the collected data as JSON
xhr.send(JSON.stringify(data));
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4 && xhr.status == 200)
{Open up Developer Tools and go to Sources.
Note the shortcut to pause script execution— F8 .
Interact with the UI to get the element to appear.
Hit F8 .
Now you can move your mouse around, inspect the DOM, whatever. The element will stay there.
https://stackoverflow.com/questions/17602611/inspect-a-hover-element
$result = $connection->insert('mytable')
->fields([
'title' => 'Example',
'uid' => 1,
'created' => \Drupal::time()->getRequestTime(),
])
->execute();
insert, update, delete, upsert
If yarn start or yarn watch is throwing any errors, try git pull, and then yarn install
Create an advancedqueue
create a file like advancedqueue.advancedqueue_queue.ipc_merge_sync.yml in modules/custom/ipc_syncdb/config/install
id: ipc_merge_sync
label: 'IPC Merge Sync'
backend: database
backend_configuration: {}
processor: cron
processing_time: 180
locked: true
then import it with drush cim --partial --source=/home/ipc/www/ipc/docroot/modules/custom/ipc_syncdb/config/install
For a multiple-value field, to add the value to the end of the list, use the following code.
$node->field_code_used_by[] = ['target_id' => $user_id];
For a single use
$group_content1->group_roles->target_id = $role_id
use Drupal\Core\Site\Settings;
$api_key = Settings::get('ipc_merge');
$key = \Drupal::request()->server->get('HTTP_X_API_KEY');
then in settings.local.php or settings.php you would put
$settings['ipc_merge'] = 'XXXXXXXXXXXXXXXXXXXXXXXX';
\Drupal::config('ipc_syncdb.settings')->get('transaction_api_log_level');
or
use Drupal\Core\Config\ConfigFactoryInterface;
$config = $this->configFactory->get('ipc_syncdb.settings');
$requestParams->logLevel = $config->get('transaction_api_log_level');
https://www.drupal.org/docs/upgrading-and-converting-drupal-7-modules/s…