Problem/Motivation
After updating the local install (ddev) to PHP 7.4 I noticed this error showing up:
Notice: Trying to access array offset on value of type int in format_string() (line 1823 of /var/www/html/includes/bootstrap.inc).
I traced it to the menu items added for 'Add discount' and 'Import discount'.
Proposed resolution
Just wrap the menu link titles in t(), don't use a title callback.
Remaining tasks
n/a
User interface changes
n/a
API changes
n/a
Data model changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | commerce_discount-n3174880-6.patch | 829 bytes | damienmckenna |
Comments
Comment #2
damienmckennaThis patch completes the suggested change; after making this change the error went away.
Comment #4
damienmckennaI forgot that menu titles are translated at runtime, so shouldn't be wrapped by t() in their hook_menu definition.
Comment #6
damienmckennaAh, I needed to unset some things. This should work.
Comment #7
joelpittetI'm not sure I understand the unsets? I understand the rest of it. Patch in #4 should have worked, no?
Comment #8
solideogloria commented@DamienMcKenna I agree with what was said in #7. The patches work, but I don't understand why the
unsetlines are needed (other than that it helps a test pass?)Comment #9
pontus.froden commented#6 works for me.
I don't get the unsets either.
Comment #10
jacob.embree commentedThe
unset()calls are necessary becausetitle callbackandtitle argumentstake precedence overtitle, and the parent class setstitle callbacktoentity_ui_get_action_title()and also setstitle arguments.Comment #11
tonytheferg commentedThanks for the patch, I am also seeing this from the links that commerce paypal creates in dblog.
Comment #12
joelpittetThe fun of inheritance, just like IRL it rarely lasts past 2 generations ;) Committed to dev branch, thanks all.