- π¬π§United Kingdom catch
Just ran into this on π Implement lazy database creation for sessions Active trying to remove system module from a test. +1 and tagging novice because this should be a straightforward change.
- Status changed to Needs work
12 months ago 7:32pm 7 May 2024 - πΊπΈUnited States joshmiller Indianapolis, Indiana, USA
Updating issue summary.
- Status changed to Active
12 months ago 7:39pm 7 May 2024 - First commit to issue fork.
- Merge request !81182851705: Replace+deprecate `DRUPAL_(REQUIRED|OPTIONAL|DISABLED)` constants in core modules β (Open) created by diegoe
- Status changed to Needs review
11 months ago 10:02am 19 May 2024 - π΅πͺPeru diegoe Lima, PerΓΊ
Opened a MR:
https://git.drupalcode.org/project/drupal/-/merge_requests/8118Opened a draft CR:
https://www.drupal.org/node/3448089 β - π«π·France andypost
needs re-run failed test as it known as random-failure
- π΅πͺPeru diegoe Lima, PerΓΊ
@andypost
I thought it was random failure at first, but then found an issue for it: https://www.drupal.org/project/drupal/issues/3448036 π InstallerTranslationExistingFileTest fails on 11.x branch Active -- There's an MR already, so hopefully it will get fixed soon. I'll rebase on top of that when it's merged.
- Status changed to Needs work
11 months ago 5:43pm 3 June 2024 - πΊπΈUnited States smustgrave
Gone back n forth but since it was a constant used through out can we add simple test coverage that if you use any of these deprecated constants you get a warning.
- π΅πͺPeru diegoe Lima, PerΓΊ
@smustgrave
> Gone back n forth but since it was a constant used through out can we add simple test coverage that if you use any of these deprecated constants you get a warning.
I couldn't find a way to trigger a runtime warning for constants. The Drupal docs have suggestions for other similar cases but not for constants:
https://www.drupal.org/about/core/policies/core-change-policies/drupal-d... β
Also looked into core's various tests but couldn't find anything that would fit here. Do you have an example?
- π³πΏNew Zealand quietone
Thanks for working on this, it would be great to have this completed.
I had a very brief look at the MR and see that it needs to be updated to meet the Drupal Coding Standards for constants β . I didn't review anything else in the MR.
- π¦πΊAustralia acbramley
acbramley β changed the visibility of the branch 11.x to hidden.
- π¦πΊAustralia acbramley
can we add simple test coverage that if you use any of these deprecated constants you get a warning
I don't think this is possible, at least I can't think of how to trigger a warning.
I had a very brief look at the MR and see that it needs to be updated to meet the Drupal Coding Standards for constants
Is this relating to this part of the standards: "Module-defined constant names should also be prefixed by an uppercase spelling of the module that defines them."? Because IMO that should not apply to constants on classes. Adding the module prefix would just duplicate what's already provided by the classname, e.g NodeTypeInterface::NODE_PREVIEW_OPTIONAL. Perhaps the docs need an update?
I've merged 11.x into the branch and updated a few more spots that were missed or added since the last merge.
- π·π΄Romania claudiu.cristea Arad π·π΄
#30 is right. When this issue has been created there was no enum support or, at least, weβve still supported old PHP versions. I think this should be rescoped to deprecate and convert some, if not all, to enums
- π¦πΊAustralia acbramley
Now using enums, I imagine the naming might be contentious here π
- π¦πΊAustralia mstrelan
Non-exhaustive review. Added some thoughts to the MR. I tend to find enums most useful when you can pass them around to functions rather than just relying on them for their backed values. In an ideal would you could use the enum for field config as well rather than the int value.
- π¦πΊAustralia acbramley
Thanks for the thorough review @mstrelan - all comments have been actioned.
- π·π΄Romania claudiu.cristea Arad π·π΄
Maybe related β¨ [PP-1] Enum cases stored in config Postponed
- πΊπΈUnited States nicxvan
Had a couple of questions.
I went through very carefully and confirmed all of the replacements align.