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.
Code affected:
function _subscriptions_get_setting($name, $account) {
...
$uid = -DRUPAL_AUTHENTICATED_RID;
...
foreach ($defaults[$uid] as $key => $value) {
if ($value < 0) { // not set, use site dft
$defaults[$uid][$key] = $defaults[-DRUPAL_AUTHENTICATED_RID][$key]; // line 872
It happens on every node page.
Backtrace:
node_view/node_build_content/module_invoke_all/subscriptions_ui_node_view/drupal_get_form/drupal_build_form/drupal_retrieve_form/subscriptions_ui_node_form/_subscriptions_get_setting
_subscriptions_get_setting( $name = 'send_interval', $account = class stdClass { public $uid = '1'; public $name = 'admin'; ... } )
$defaults:
&
array (size=1)
1 =>
array (size=13)
'uid' => string '1' (length=1)
'digest' => string '-1' (length=2)
'send_interval' => string '-1' (length=2)
'send_updates' => string '-1' (length=2)
'send_comments' => string '-1' (length=2)
'send_interval_visible' => string '-1' (length=2)
'send_updates_visible' => string '-1' (length=2)
'send_comments_visible' => string '-1' (length=2)
'autosub_on_post' => string '-1' (length=2)
'autosub_on_update' => string '-1' (length=2)
'autosub_on_comment' => string '-1' (length=2)
'send_self' => string '-1' (length=2)
'uses_defaults' => boolean false
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedProposed patch:
Comment #2
salvisThank you for your report. I'm not sure how to reproduce this just yet, but let's get the following out of the way first:
Have you tried the -dev version?
Patches should go against the -dev version and be attached as files. Even though Subscriptions has no tests, automatic testing is enabled and is very helpful as a first gate to check whether the patch applies (to the right branch).
Comment #3
DamienMcKennaThe same code is in the -dev version. The question is - why does $defaults[-DRUPAL_AUTHENTICATED_RID][$key] not exist? Did the defaults not load correctly?