dnadesign / silverstripe-elemental-virtual

Allows Content Blocks to be reused between pages.
BSD 3-Clause "New" or "Revised" License
7 stars 26 forks source link

Virtual Forms Elements Don't Work #39

Closed robingram closed 1 year ago

robingram commented 3 years ago

If a virtual element is added that links to an ElementForm from Elemental Userforms an error is generated when the form is submitted.

Fatal error: Element $id not found for this page in /.../vendor/dnadesign/silverstripe-elemental/src/Extensions/ElementalContentControllerExtension.php on line 47

I'm not suggesting that there is a simple solution to this, if any. Just wondering if you had any thoughts.

If there isn't a way to effectively access the form controller then I think at the least it would be good to prevent the sharing of Form elements. I couldn't find a way to extend the element to permanently turn off availableGlobally without completely overriding the class.

lerni commented 2 years ago

Disable or preventing virtual UserFormElements I handle with removing AvailableGlobally-filed but if that functionality would be possible, it really has a huge trouble/time-saving potential for authors. I had several requests making this possible since recreating forms and having submissions in different instances is a cumbersome user experience.

wilr commented 1 year ago

@robingram Have had a client request this now and fix is in the pipeline. Should have a PR asap.

wilr commented 1 year ago

Fixed in 467885dea8cb3867f3839aa286898b7b1dd13cd5

rasstislav commented 11 months ago

Hi @wilr.

This issue still exists in old version (branch 1) for elemental v4. Is it possible to backport this patch commit to version 1?

Thanks