Closed (fixed)
Project:
Multiple Registration
Version:
8.x-2.91
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
14 May 2020 at 13:06 UTC
Updated:
6 Jun 2020 at 12:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pradeepjha commentedComment #3
TommasoArmadillo commentedHi! I had the same issue after I applied the patch given in
https://www.drupal.org/project/multiple_registration/issues/3136321
In order to solve this in the file
modules/multiple_registration/src/Controller/MultipleRegistrationController.phpI changed line 7-8to
and this worked for me! Sorry but I'm quite a beginner so I don't know how to write a patch
Comment #4
pradeepjha commentedRe-produce Error:
After filling all required value in multiple registration form, on submitting registration form this error will show.
So attached patch will resolve this issue.
AliasStorage class is deprecated in Drupal-8.8.x version. So you have to use the "path_alias.repository" service instead. Ref- https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Path%21Al....
Comment #5
pradeepjha commentedMinor change in patch.
Comment #6
Rkumar commentedComment #7
ysamoylenko commentedHello @pradeepjha,
Thank you for your patch.
As you are implementing your functionality in the controller you should avoid using \Drupal::service('service_name') construction.
Use dependency injection instead.
Also, as I see you've changed configuration placeholder from ''multiple_registration_url_' . $rid' to ''multiple_registration_path_' . $rid'
This is not a good idea because it will break module functionality for users which will switch from an older version of the module to the new one.
Their aliases will lose in this case and we can't do that.
Also, if you removing some of the class references from the codebase, don't forget to remove them from use statements to keep the code clear.
Comment #8
pradeepjha commentedComment #9
pradeepjha commentedHi @ysamoylenko,
I've updated patch.
Comment #10
pradeepjha commentedParameter is added.
Comment #11
ysamoylenko commentedHello @pradeepjha,
Yes, you are right, now we should use just an alias instead of conditions like previously.
But, according to API reference:
https://www.drupal.org/node/3013865
We can't use 'path.alias_storage' service for now, because it is deprecated:

So, you may use entity type manager reference to the entity and remove aliases, in a pretty similar way as your variant or use 'path_alias.repository' which is also still uses deprecated core functionality inside.
I suggest using the first option with an injection of entity type manager and use the structure like:
Comment #12
ysamoylenko commentedComment #13
pradeepjha commentedComment #14
pradeepjha commentedThanks @ysamoylenko
I've used injection of entitytype. I've removed all deprecated service.
Same like previous version, instead of deleting path alias we can delete source path (System path) alias. Which works fine. Please apply the patch and test it.
Comment #15
driverok commentedI can confirm that #14 works well for me - while submitting the Registration page form there is no errors.
With #14 applied drupal-check, rector, and upgrade-status return no errors.
Also I've checked #14 with drupal 9.0.0-beta3 - works well.
so RTBCing.
Comment #16
ysamoylenko commentedHello everyone,
I've tested #14 with D8.8.6 core and everything works as expected.
Thanks all contributors for your efforts.
The patch will be committed soon.
Comment #18
ysamoylenko commentedComment #19
nikolas.tatianenko commented