This is blocking #2844054: Inline Revisionable Content Blocks.

At the moment it's impossible to use IPE to create or edit blocks which use an inline entity form in their configuration. This is because IEF needs to hook itself into a submit button, but Panels IPE's block plugin form defines both the submit and preview buttons as normal buttons, not submit buttons, and therefore they will not execute any submit callbacks. Which means they will completely bypass any kind of IEF stuff.

The solution here, as I discussed yesterday with @EclipseGc and @samuel.mortenson, is to split the submitForm() method into two methods -- the actual submit function that saves the data, and the AJAX callback which prepares and returns the response content. We proved in manual testing that this will allow IEF to run as and when it should, while the AJAX functionality will continue to work the way it should.

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new2.42 KB
damienmckenna’s picture

Lets put this in beta7 so #2844054 can be added to CTools.

eclipsegc’s picture

StatusFileSize
new2.12 KB

Ok, this patch is officially dependent on [##2844054] now. I could break out the part of that patch this depends on though if we want to move forward with this faster.

I'm introducing a new service to ctools that allows a tempstore to be serializable. Updated PanelsIPEBlockPluginForm to use this new service. This allows our wizarded steps to continue working when core uploads an imagefield in the middle of our process which is necessary for inline blocks.

Eclipse

Status: Needs review » Needs work

The last submitted patch, 4: 2854542-4.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
Related issues: +#2858103: Add serializable tempstore service (extracted from #2844054)
StatusFileSize
new3 KB
new1.65 KB

The tempstorage service was moved into #2858103: Add serializable tempstore service (extracted from #2844054), so that's now what's required.

This adds some extra comments.

Status: Needs review » Needs work

The last submitted patch, 6: panels-n2854542-6.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
samuel.mortenson’s picture

+++ b/panels_ipe/src/Form/PanelsIPEBlockPluginForm.php
@@ -78,7 +75,7 @@ public static function create(ContainerInterface $container) {
-      $container->get('user.shared_tempstore')
+      $container->get('ctools.serializable.tempstore.factory')

I reviewed the Panels codebase and we use the "user.shared_tempstore" service in a number of locations. Do we need to change it everywhere, and if not why does this form in particular need the change?

panels (8.x-3.x) $ grep user.shared_tempstore -R .
./panels_ipe/src/Controller/PanelsIPEPageController.php:      $container->get('user.shared_tempstore'),
./panels_ipe/src/Form/PanelsIPEBlockPluginForm.php:      $container->get('user.shared_tempstore')
./panels_ipe/src/Form/PanelsIPELayoutForm.php:      $container->get('user.shared_tempstore')
./panels_ipe/src/Plugin/DisplayBuilder/InPlaceEditorDisplayBuilder.php:      $container->get('user.shared_tempstore'),
./src/Controller/Panels.php:      $container->get('user.shared_tempstore'),
./src/Form/LayoutChangeRegions.php:      $container->get('user.shared_tempstore')
./src/Form/LayoutChangeSettings.php:      $container->get('user.shared_tempstore')
./src/Form/LayoutPluginSelector.php:      $container->get('user.shared_tempstore')
./src/Form/PanelsAddBlockForm.php:      $container->get('user.shared_tempstore'),
./src/Form/PanelsBlockConfigureFormBase.php:      $container->get('user.shared_tempstore')
./src/Form/PanelsContentForm.php:      $container->get('user.shared_tempstore')
./src/Form/PanelsDeleteBlockForm.php:      $container->get('user.shared_tempstore')
tim.plunkett’s picture

a) The "new" tempstore has a one line addition to the core one. It should have an @todo referencing a core issue to simply add that one line.
b) From my understanding, this would be a rare class to swap out, and would be reasonable for CTools to do so. Then the service name wouldn't need to be changed.
c) If that's too much to ask, the service could be decorated

timodwhit’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
Status: Needs review » Needs work

It appears this patch will need a reroll, and an update for 8.x-4.x, bumping version and status.

Also, I believe this change would be needed for PanelsIPEBlockContentForm as well.