Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is an issue with Drupal Commerce, or perhaps Core https://drupal.org/node/1392654. However in the meantime we could remove the notices, and the user would be redirected back to the cart for now by simply checking whether 'path' is set in the $uri array. I made a quick patch (until the issue gets resolved). I am simply checking for path using array_key_exists().
Comment | File | Size | Author |
---|---|---|---|
#19 | registration-host_entity_uri-2015341-19.patch | 2.23 KB | nrackleff |
#16 | registration-host_entity_uri-2015341.patch | 2.31 KB | AaronBauman |
Comments
Comment #1
agileadamHey choicelildice,
Looks like you came to the same conclusion as me! I suggest updating your patch to use isset() instead of array_key_exists() for a slight efficiency/performance increase.
#1900618: Undefined index: path in registration_form()
Cheers!
Comment #2
carsonblack CreditAttribution: carsonblack commentedAttached is a patch using isset. DO NOT USE! Re-rolling to make it so it will work from the module's directory.
Comment #3
carsonblack CreditAttribution: carsonblack commentedHere is a properly formatted patch using isset.
Comment #4
carsonblack CreditAttribution: carsonblack commentedKeep an eye on this related core issue that may render this patch obsolete: https://drupal.org/node/1275902
Comment #5
tanmaykCommerce product module defines uri callback (commerce_product_uri) for product but doesn't actually define any menu items. If we observe the code for commerce_product_uri, it checks for hook_commerce_product_uri implementations. If there are no implementations, it returns NULL hence only 'options' are set in entity_uri().
I implemented that hook and warning disappeared. We will no longer need to implement it if #1275902: Allow entity URI callbacks to indicate that the entity has no URI, and make the User module use that for anonymous users is getting fixed. Hope this helps.
Comment #6
tanmaykThis will also fix #1900618: Undefined index: path in registration_form()
Comment #7
brandonratz CreditAttribution: brandonratz commented@tanmayk
I confirm this fixes the 'Registration' module. I was receiving the following notice:
Notice: Undefined index: path in registration_form() (line 153 of .../sites/all/modules/contrib/registration/includes/registration.forms.inc).
Comment #8
jbabiak CreditAttribution: jbabiak at OpenConcept Consulting Inc. commentedPatch at #3 worked for me, but then I found another very similar issue. Using the same approach I have added another check for uri path to avoid having any more warnings appear. I have also included the patch from #3 here aswell
Comment #9
mgiffordComment #10
Greg BoggsThe patch looks good jbabiak. For completeness, can you tell me what I need to do to replicate the notice?
Comment #11
LeDucDuBleuet CreditAttribution: LeDucDuBleuet as a volunteer and commentedThis issue still occurs with version 1.5 of entity registration using Commerce Registration 2.1.
Patch in #8 removes the notice.
Thank you!
Comment #12
Greg BoggsLeDucDuBleuet,
Were you getting the notice from patch 8 or patch 3 or both? Was the notice on 154 or 73 or both?
Comment #13
acrazyanimal CreditAttribution: acrazyanimal commentedYes the issue occurs when using the commerce_registration module.
The issue is that the registration form is being included and displayed directly on the checkout forms, so there is no need for a cancel link that needs to redirect back to anywhere else or a link to the host entity. Patch in #3 fixes the cancel link case and #8 extends that to fix both the issue with the cancel link and the link back to the host entity. In the case of commerce_registration there isn't really a path to view a product entity. The patches fix these cases by not building the links within the form if no uri parameters have been provided.
Like @leducdubleuet, I can also confirm that patch #8 fixes the issues listed here.
Comment #14
bengraham11 CreditAttribution: bengraham11 as a volunteer commentedTook the changes from #8, made them work for Entity Registration module version 7x.-1.6
Comment #15
dshields CreditAttribution: dshields at OpenConcept Consulting Inc. commentedApplies nicely to latest code
Comment #16
AaronBaumanworks great for me.
re-rolled to remove "sites/all/modules/registration" from paths.
Comment #17
pwsherman CreditAttribution: pwsherman commentedI applied the patches for 7.x-1.6 and now the event name is not displaying. And I get this error:
This registration is for: field is required.
Comment #18
LeDucDuBleuet CreditAttribution: LeDucDuBleuet as a volunteer and commented@pwsherman Are you sure you applied the patch correctly?
It works well up here.
Comment #19
nrackleff CreditAttribution: nrackleff commentedHere is a newer version of the patch that removes hard coded "sites/all/modules/registration" from 'b' as well. Previous patch had removed it from 'a' only on diff lines.
Comment #21
nrackleff CreditAttribution: nrackleff commentedThis has been committed and will be in the next 1.x release.
Comment #23
jweirather CreditAttribution: jweirather commentedUPDATE: As of April 18, 2018, the patch from #19 DID RESOLVE the issue for me, patching against the 7.x-1.6 recommended/stable release, from 7 October 2015.
For me, I was seeing the issue when adding registration fields in views (such as edit/delete registration). In my case, these registrations were tied to commerce transactions, through the commerce registration module.