- 🇨🇦Canada joseph.olstad
RTBC patch #9
We need this change for PHP 8.2 compatibility, it's the same change that's been used in Drupal 10 core, in other drupal 7 contrib modules such as webform and i18n and others.
The test fails are unrelated and this change will not cause a regression.
- Status changed to Needs review
almost 2 years ago 6:16am 26 January 2023 - 🇨🇦Canada joelpittet Vancouver
Need a second pair of eyes from the community to RTBC.
There are no failing tests that this patch resolves (that I could see).
No steps to reproduce the errors though it's marked as a feature request the title is nebulous about the testbot composer issues.
This needs a better title and a clear set of instructions to test so we know the changes are not just for change sake. - 🇨🇦Canada joelpittet Vancouver
@joseph.olstad Sorry not meant to derail your progress. Thanks for taking the time to get things ready for PHP 8.2 and fixing the color issue that has plagued me in other issues too!
- 🇨🇦Canada joseph.olstad
To reproduce the errors, run the automated tests against HEAD with PHP 8.2
Here's a no_change patch to prove failures.
- 🇨🇦Canada joseph.olstad
The above no_change.patch fails PHP 8.2 testing.
Please review/apply/commit/tag/release with patch 16 to resolve the ctools PHP 8.2 compatibility issues.
- 🇨🇦Canada joseph.olstad
@Joel Pittet, to give you a bit more background information, I've written PHP 8.2 compatibility patches for the following modules and they have been committed and released:
entity_translation
#3327347-37: Fully Support PHP 8.2 →
file_entity
#3327347: Fully Support PHP 8.2 →
date module
📌 PHP 8.2 - Fix deprecated dynamic properties Fixed
media
✨ Media - PHP 8.2 compatibility Fixed
i18n
#3327343: Fully Support PHP 8.2 →
entityreference
🐛 PHP 8.2 compatibility fix Fixed
webform
🐛 PHP 8.2 compatibility fix Fixedand a few others.
These are all very similar fixes to patch 16.
This is a very simple fix that we need to move forward on in order to keep fixing the modules that depend on ctools. Please consider fast tracking patch 16. There's a lot of other projects I'd like to continue fixing and this one is holding things up.
- 🇨🇦Canada joseph.olstad
@joel pittet, in PHP 8.2 Dynamic Properties are deprecated in the sense that they are now disabled by default on all classes. This is to improve performance and reduce memory consumption. If a class doesn't need dynamic properties support PHP 8.2 does not load it unless explicitly asked on a class by class basis.
Patch 16 above is very simple, adding two missing properties to one class and explicitly enabling Dynamic properties on the other.
The upgrade to PHP 8.2 is a significant performance improvement and once again lowers memory footprint.
Patch 16 resolves 4 HEAD failures as illustrated above. Patch 16 is very similar to the rest of the PHP 8.2 fixes that have already gone into core and many contrib modules and dependencies.
The webform module needed a fix due to someone misspelling a property , previous versions of php just added the property dynamically but PHP 8.2 will not do this unless the class has a Dynamic Properties directive.
Does this help ?
- Status changed to Fixed
almost 2 years ago 12:57am 28 January 2023 - 🇨🇦Canada joelpittet Vancouver
Oh the illustration with the failed tests really helps and the detailed explaination, thanks again @joseph.olstad
-
joelpittet →
committed 48377d1e on 7.x-1.x authored by
joseph.olstad →
Issue #3327350 by joseph.olstad, joelpittet, poker10: Support PHP 8.2...
-
joelpittet →
committed 48377d1e on 7.x-1.x authored by
joseph.olstad →
- 🇨🇦Canada joelpittet Vancouver
I committed this to D9 and wonder if it's relevant (will test tomorrow) but since you are doing some 8.2 support I'll ask your take?
📌 PHP 8.2: ${var} in strings is deprecated Fixed
D7 findings
❯ ag '\$\{' includes/export.inc 283: if (empty(${$export['identifier']})) { 291: $item = ${$export['identifier']}; 1237: $output .= " \${$export['identifier']}s = array();\n\n"; 1240: $output .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n"; 1242: $output .= " return \${$export['identifier']}s;\n"; page_manager/page_manager.module 1202: $code .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n"; 1204: $code .= " return \${$export['identifier']}s;\n";
- Status changed to Needs work
almost 2 years ago 6:38am 28 January 2023 - 🇨🇦Canada joelpittet Vancouver
I noticed a few more while enabling a bunch ctools modules:
Deprecated function: Creation of dynamic property view::$export_module is deprecated in _ctools_export_get_defaults() (line 689 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/export.inc). Deprecated function: Creation of dynamic property view::$export_type is deprecated in ctools_export_load_object() (line 538 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/export.inc). Deprecated function: Creation of dynamic property view::$in_code_only is deprecated in ctools_export_load_object() (line 539 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/export.inc). Deprecated function: Creation of dynamic property view::$table is deprecated in ctools_export_load_object() (line 540 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/export.inc). Deprecated function: Creation of dynamic property view::$type is deprecated in ctools_export_load_object() (line 537 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/export.inc).
- Status changed to Fixed
almost 2 years ago 7:08am 28 January 2023 - 🇨🇦Canada joelpittet Vancouver
I just realized #29 is all the view class from views which has been fixed already in dev with
#[\AllowDynamicProperties]
#28 I'm still investigating but we can create a follow-up
- Status changed to Active
almost 2 years ago 7:55am 28 January 2023 - 🇨🇦Canada joseph.olstad
Just going to trigger a no change test because ci on main project returns error today
- Status changed to Fixed
almost 2 years ago 7:59am 28 January 2023 - 🇨🇦Canada joseph.olstad
Just looking at comment 28 no change patch, expecting pass on all tests
- 🇨🇦Canada joseph.olstad
Ok 21 is passing, @Joel Pittet could you please retrigger the project tests for ctools? Why would the no change patch work and the project tests on commit , not work?
Perhaps retrigger those and we can review that. Required maintainer prerms to do this - 🇨🇦Canada joelpittet Vancouver
I'll retrigger them thanks. I don't think the stuff I mentioned in #28 above have test coverage.
- 🇨🇦Canada joelpittet Vancouver
Deprecated function: Creation of dynamic property ctools_context::$arg_length is deprecated in ctools_plugin_example_context_create_simplecontext() (line 80 of /var/www/html/public/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc).
One more
- Status changed to Needs work
almost 2 years ago 10:54pm 28 January 2023 - 🇨🇦Canada joelpittet Vancouver
Maybe
ctools_context
should also have#[\AllowDynamicProperties]
, that might help other ecosystem modules that add stuff to context? - 🇨🇦Canada joelpittet Vancouver
And same for
ctools_context_required
Deprecated function: Creation of dynamic property ctools_context_required::$restrictions is deprecated in ctools_context_required->__construct() (line 275 of /var/www/html/public/sites/all/modules/contrib/ctools/includes/context.inc).
Deprecated function: Creation of dynamic property ctools_context_required::$restrictions is deprecated in DrupalDatabaseCache->prepareItem() (line 449 of /var/www/html/public/includes/cache.inc). - Status changed to Needs review
almost 2 years ago 12:10am 29 January 2023 - 🇨🇦Canada joelpittet Vancouver
I did some testing and exporting and #28 is not an issue.
Thoughts on this patch in relation to the comments #38 and #40?
- 🇨🇦Canada joelpittet Vancouver
Changing parent to the release plan 🌱 Plan for CTools 7.x-1.21 release Fixed
- 🇨🇦Canada joseph.olstad
Patch looks good, put it in as a compatibility insurance policy IMHO good to go in.
-
joelpittet →
committed d1236feb on 7.x-1.x authored by
joseph.olstad →
Issue #3327350 by joseph.olstad, joelpittet, poker10: Support PHP 8.2...
-
joelpittet →
committed d1236feb on 7.x-1.x authored by
joseph.olstad →
- Status changed to Fixed
almost 2 years ago 7:57am 29 January 2023 - 🇨🇦Canada joelpittet Vancouver
I'll release this soon, just need to get the branch to pass the tests
- 🇨🇦Canada joseph.olstad
weird that the project tests are outputing such a strange output about being hundred+ commits behind and what's this about a production branch?
I've added a comment here:
#3332436-13: Refactor & correct list of removed core modules →
- 🇨🇦Canada joelpittet Vancouver
I asked around and hestenet mentioned this was the issue #3315509: phpcs endless loop with "Drupal" rules due to missing @endcode → so I did those fixes here 🐛 phpcs endless loop with "Drupal" rules due to missing @endcode Fixed
Automatically closed - issue fixed for 2 weeks with no activity.