Problem/Motivation
After switch to php7.4 I catched some errors
Notice: Trying to access array offset on value of type null in amp_node_view() (line 673 of ../contrib/amp/amp.module). request_id="v-77a60632-686d-11eb-bb4b-ff0915a6cda2"
Notice: Trying to access array offset on value of type null in amp_node_view() (line 676 of ../amp/amp.module). request_id="v-77a60632-686d-11eb-bb4b-ff0915a6cda2"
Notice: Trying to access array offset on value of type null in amp_node_view()
Steps to reproduce
1. Enable php7.4
2. Go to some amp page
3. Check logs
Proposed resolution
I would suggest to apply a patch
Patch update for fixing PHP8.1 deprecations:
Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in amp_node_view() (line 692 of modules/contrib/amp/amp.module).
Deprecated function: substr(): Passing null to parameter #1 ($string) of type string is deprecated in amp_node_view() (line 710 of modules/contrib/amp/amp.module).
Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in {closure}() (line 758 of
modules/contrib/amp/amp.module).
Comments
Comment #2
Andrei Haurukovich commentedComment #3
Andrei Haurukovich commentedComment #4
Natallia commentedPatch update for fixing PHP8.1 deprecations
Comment #5
Natallia commentedComment #6
Andrei Haurukovich commentedComment #7
alena_stanul commentedThese types of warnings are considered in PHP 8.1 warnings. Passing null to parameter of type string is deprecated issue.