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.
Using PHP 7 I am seeing the following notice:
Notice: Array to string conversion in _token_token_tree_format_row() (line 207 of .../modules/contrib/token/token.pages.inc).
Code is setting $row['data']['name']['class']
as an array, but expecting a string.
Comment | File | Size | Author |
---|---|---|---|
#9 | array-to-string-conversion-notice-3048863-9.patch | 1.25 KB | joseph.olstad |
Comments
Comment #2
smulvih2Patch to remove notice.
Comment #3
smulvih2Here is a new patch that fixes other issues with the _token_token_tree_format_row() function with regards to PHP 7 and setting arrays properly.
Comment #4
smulvih2Comment #5
joseph.olstadLe correctif fonctionnent.
php 7.4 sera prise en charge par Drupal core 7.71, dépêchons nous, pousse ce code ! c'est prêt.
Comment #6
Dave ReidNeither patch applies to the module currently. I believe this was fixed by #2825841: Error : Cannot use string offset as an array in _token_token_tree_format_row()?
Comment #7
joseph.olstad@Dave Reid ,
that patch related issue was over 4 years ago, the above patch is 9 months ago.
I think this above patch is still needed
Comment #8
Dave ReidThe patch above does not apply to the current code at all, I will need an updated patch that does apply in order to fix it. There is no section of code that has
$row['data']['name']['class'] = array('token-name');
Comment #9
joseph.olstadNew patch
Comment #10
joseph.olstadTry this
Comment #11
Dave ReidTwo questions on this:
1. Isn't $row['data']['name'] an array now with the patch, and this is now trying to set it to a string?
2. Why adding the class? I don't necessarily mind it but this seems to be new and I'm just curious as to why it's being added here. This was part of my original confusion about the other patches.
Comment #12
joseph.olstadwasn't sure about that line, was just trying to reroll the patch
I know I did need the patch as it was prior