Warning: Trying to access array offset on value of type null in Drupal\node_revision_delete\NodeRevisionDelete->updateTimeMaxNumberConfig()

Both a further fix is needed and a correction after #3279731: Handle NULL third_party_settings in updateTimeMaxNumberConfig().

It looks to me that the intent of #3279731: Handle NULL third_party_settings in updateTimeMaxNumberConfig() was to just fix a warning but not change the behavior.
It did fix the warning for the case when third party settings is completely undefined but it did not fix the same warning for the case when the third party settings for node_revision_delete were undefined.
At the same time that fix changed the behavior to now save (partial) config when the setting was undefined. The old behavior was to effectively only save when an old value existed (and was bigger), only doing so when a positive integer was smaller than an existing value or smaller than an undefined value evaluating to 0.

Comments

Eric_A created an issue. See original summary.

eric_a’s picture

Title: Handle NULL third_party_settings['node_revision_delete'] in updateTimeMaxNumberConfig() » Handle undefined third_party_settings['node_revision_delete'][$config_name] in updateTimeMaxNumberConfig()
Parent issue: #3279731: Handle NULL third_party_settings in updateTimeMaxNumberConfig() »
Related issues: +#3279731: Handle NULL third_party_settings in updateTimeMaxNumberConfig()
eric_a’s picture

Title: Handle undefined third_party_settings['node_revision_delete'][$config_name] in updateTimeMaxNumberConfig() » Handle NULL $third_party_settings['node_revision_delete'] in updateTimeMaxNumberConfig()
eric_a’s picture

Assigned: eric_a » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new903 bytes

It looks to me that the intent of #3279731: Handle NULL third_party_settings in updateTimeMaxNumberConfig() was to just fix a warning but not change the behavior.
It did fix the warning for the case when third party settings is completely undefined but it did not fix the same warning for the case when the third party settings for node_revision_delete were undefined.
At the same time that fix changed the behavior to now save (partial) config when the setting was undefined. The old behavior was to effectively only save when an old value existed (and was bigger), only doing so when a positive integer was smaller than an existing value or smaller than an undefined value evaluating to 0.

So here's a patch that fixes warnings and changes the behavior back to pre RC5.

eric_a’s picture

Issue summary: View changes
eric_a’s picture

Priority: Normal » Major
Issue summary: View changes

Perhaps an unintended behavior change in RC5 warrants priority major.

eric_a’s picture

Issue summary: View changes
eric_a’s picture

Issue summary: View changes

  • adriancid committed 774fdcb on 8.x-1.x
    Issue #3323170 by Eric_A, adriancid: Handle NULL $third_party_settings['...
adriancid’s picture

Status: Needs review » Fixed

Thanks

eric_a’s picture

Title: Handle NULL $third_party_settings['node_revision_delete'] in updateTimeMaxNumberConfig() » Handle undefined node_revision_delete third party settings in updateTimeMaxNumberConfig()
eric_a’s picture

Oops, when changing the title (again) I hadn't noticed that the issue was already fixed.
@adriancid, thanks for the quick action!
(Not sure what to do with the title now.)

adriancid’s picture

You can leave it as it is, google will do the rest :-D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.