Problem/Motivation
Can not install quick_node_clone when has the address:^2.0@beta
AddressEvents::INITIAL_VALUES deprecated in address:8.x-1.5 and is removed from address:8.x-2.0
https://www.drupal.org/project/address/issues/2838457
Error: Undefined constant Drupal\address\Event\AddressEvents::INITIAL_VALUES in Drupal\quick_node_clone\EventSubscriber\AddressEventSubscriber::getSubscribedEvents()
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff_3-6.txt | 558 bytes | samitk |
| #6 | 3376504-6.patch | 655 bytes | samitk |
| #3 | quick_node_clone_3376504_2.patch | 594 bytes | spfaffly |
Issue fork quick_node_clone-3376504
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
linhnm commentedComment #3
spfaffly commentedProbably not the best solution but commenting out the offending code for now at least gives us a path forward to an installable state.
Patch file attached.
Comment #4
linhnm commentedComment #5
samitk commentedComment #6
samitk commentedI guess, instead of comment the code, we can validate like constant is exists or not.
interdiff with #2
Comment #7
caspervoogt commentedThe patch from #6 worked for me
Comment #8
tea.time commentedThese patches are both skipping subscribing to the
AddressEvents::INITIAL_VALUESevent if it isn't defined by the Address module... but without running that event handler that would be attached, isn't that going to break some functionality of Quick Node Clone? It appears to be setting initial values in an address field from the current node. So if the Address module has removed the event, I'd think Quick Node Clone needs to implement that same functionality another way.Comment #9
linhnm commentedAgree with @tea.time. Move to NW
Comment #10
anybodyAddress 2.0 is now stable, so this issue becomes even more critical.
Comment #11
jacobbell84 commentedI believe the approach for patch #6 is correct here. Looking through the patch in #2838457: Re-enable the default value functionality for Address fields, it was more than deprecating this functionality. They actually removed all the code that fired the event, so it hasn't been doing anything since version 1.5 of Address.
The original verbiage change to the function header comment made that more clear, before it was updated to the more generic deprecation description in a later issue.
Given that, I think doing a simple check of the event constant's existence is a reasonable fix, as it allows us to support the older versions of the Address module without breaking when version 2 is used. I tested patch 6 on one of my sites that use the Address module, and the address content still cloned without issue, so marking this as RTBC
Comment #12
trickfun commentedPatch #6 works fine.
Comment #13
mkalkbrennerYes, this one is critical. A composer update now lets a site run into fatal errors.
Comment #14
kumkum29 commentedPatch #6 works fine.
Do you think to include this fix in the dev or next release ?
Without this patch, and with a composer update my site is broken.
Thanks.
Comment #15
anybodyI pinged the both maintainers, hope they hear us. Indeed critical!
Comment #19
markdorisonI created an MR from the patch so tests could run. Resolved a small PHPCS issue. Committing this now. Thanks for the ping!
Comment #20
anybodyThank you very very much @markdorison!! :)