WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

Platform.sh commands

Submitted by barnettech on Fri, 03/25/2022 - 10:12

Activate a new branch and have it register in platform.sh:

platform environment:activate new-feature

Importing data:

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

Exporting data:

platform db:dump --gzip

JavaScript post request

Submitted by barnettech on Wed, 03/02/2022 - 15:03
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)
      {

Create an advancedqueue

Submitted by barnettech on Tue, 11/09/2021 - 17:04

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