- Issue created by @Volha_Si
- Status changed to Needs work
over 1 year ago 11:56am 7 August 2023 - 🇸🇰Slovakia poker10
Thanks for reporting and working on this!
I checked the code and yes, the proposed patch will fix the deprecation messages, but it will not fix the root cause of this issue (a coding style bug). I suppose that the problem itself is here: https://git.drupalcode.org/project/advagg/-/blob/7.x-2.x/advagg.missing.... , where the
$contents
variable is defined only in theIF
branch of that condition. Therefore it can be undefined (NULL
). See:if (is_readable($file)) { ... $contents = advagg_load_css_stylesheet($file, $optimize, $aggregate_settings, $file_contents); } else { // File is not readable. $write_aggregate = advagg_missing_file_not_readable($file, $aggregate_filename, TRUE); } ... if ($media_changes) { $media_blocks = advagg_parse_media_blocks($contents); ... }
I propose that we fix the problem here - it could be sufficient to initialize the empty
$contents
variable in theelse
branch of the condition, or before the condition, or similar. Thanks! - First commit to issue fork.
- last update
over 1 year ago 6 pass - Status changed to Needs review
over 1 year ago 12:58pm 7 August 2023 - last update
over 1 year ago Patch Failed to Apply - Status changed to Needs work
over 1 year ago 1:10pm 7 August 2023 - 🇸🇰Slovakia poker10
This still needs work. The merge request added the variable initialization after the opening
IF
. This would not help, because in theelse
branch it would still be undefined.else { // File is not readable. $write_aggregate = advagg_missing_file_not_readable($file, $aggregate_filename, TRUE); }
Also please do not remove the
$contents = '';
after theadvagg_parse_media_blocks()
call, because it has different purpose (to cleanup the variable, which is being reused later). This has nothing to do with this problem.$media_blocks = advagg_parse_media_blocks($contents); - $contents = '';
Thanks!
Poker10, thank you for your notice.
I've put the check after if/else - it will catch null in case of 'else'-branch execution and also in case of smth wrong during 'if'-branch execution.- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - 🇸🇰Slovakia poker10
Thanks! Patch looks good, but unfortunatelly it does not apply.
- last update
about 1 year ago 6 pass - last update
8 months ago 6 pass - 🇸🇰Slovakia poker10
@aquaphenix Which patch have you re-rolled? Your patch is not same as patch in #9 and brings back the PHP 5.6 incompatibility. Please pay attention while re-rolling patches, so that the latest patch is re-rolled.
Anyway, we have a open MR here: https://git.drupalcode.org/project/advagg/-/merge_requests/30 , so please let's just continue here. I am hiding all patches in this issue. We need to update the MR to match the patch #9 and then we can review this. Thanks!
- First commit to issue fork.
- last update
8 months ago 6 pass - 🇮🇳India mukhtarm
Hi, resolved the MR to apply the patch #9. Please review, thanks.
- last update
8 months ago 6 pass - Status changed to Needs review
8 months ago 9:46am 28 March 2024 - Status changed to Needs work
8 months ago 6:42pm 28 March 2024 - last update
8 months ago 6 pass - 🇮🇳India mukhtarm
@poker addressed #16 🐛 PHP 8.1 compatibility issues: passing null to strlen() and strpos() is deprecated Needs work
- last update
8 months ago 6 pass - last update
8 months ago 6 pass - 🇸🇰Slovakia poker10
I have done small fixes in the MR, otherwise I think this looks good.
- Status changed to RTBC
8 months ago 7:15pm 3 April 2024 -
poker10 →
committed 76b00db6 on 7.x-2.x authored by
sakthi_dev →
Issue #3379647 by Volha_Si, MukhtarM: PHP 8.1 compatibility issues:...
-
poker10 →
committed 76b00db6 on 7.x-2.x authored by
sakthi_dev →
- Status changed to Fixed
8 months ago 7:16pm 3 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.