Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to run the following command lines to create a zone and add some records to them:
drush @server_master provision-zone create foobar.com
drush @server_master provision-zone rr-add foobar.com www A 1.2.3.4
The zone gets created. But the rr-add command throws an error at line 44 of dns.drush.inc
With the following change the record is added correctly.
$record = d()->service('dns')->config('zone', $zone)->record_get($name);
if (!is_array($record[$type])) {
$record[$type] = array();
}
$record[$type] = array_merge($record[$type], array($destination));
It seems that $record is not initialized the first time a zone gets created through drush.
Comments
Comment #1
anarcat CreditAttribution: anarcat commentedFix committed, thanks. In the future, please provide a proper patch and mark the issue as "needs review", see also http://drupal.org/patch/create