- Issue created by @pdureau
- 🇫🇷France pdureau Paris
I take it because I work on similar topics in 📌 [1.0.0-beta1] Add proper page management Active
- 🇫🇷France pdureau Paris
Also, this is the opportunity of adding config dependency management
- In Entity Display: add display builder config entity
- In Views: add display builder config entity
- In Page Layout: already done in 📌 [1.0.0-beta1] Add proper page management Active
- 🇫🇷France pdureau Paris
3 information:
- Instance ID are used in HTML classes, so let's avoid dots.
- "display_builder_" prefix is already added by State Manager's Storage service, no need to specify it here
- Entity ID is enough as a scope, because all entity IDs are in the same namespace
So, proposal:
{entity_type_id}--{entity_id}
- 🇫🇷France pdureau Paris
It seems
DisplayBuilderEntityViewDisplay
can also implements the upcomingEntityWithDisplayBuilderInterface
:) - 🇫🇷France pdureau Paris
This is also the opportunity to fix a bug in Display Buidler View: the render is made from the State Manage data instead of the data saved in config.
- 🇫🇷France pdureau Paris
We will also be able to remove
StorageProperties::InstanceId->value,
because there will have no need of storing this to config now we haveEntityWithDisplayBuilderInterface::getInstanceId()
- Merge request !42Issue #3534215 by pdureau, mogtofu33: Implement WithDisplayBuilderInterface in Views → (Open) created by pdureau
- 🇫🇷France pdureau Paris
Nearly done. It will be a biiiiig MR.
DONE.
- Implement
EntityWithDisplayBuilderInterface
for View - Implement
EntityWithDisplayBuilderInterface
for Entity View - Implement
EntityWithDisplayBuilderInterface
(partially) for Devel - Same form for all (
ConfigFormBuilder
) - Remove
StorageProperties::InstanceId->value</code</li> <li>Remove <code>DisplayBuilder::DISPLAY_BUILDER_CONFIG
- Remove
enabled
in Entity View - Fix: "the render is made from the State Manager data instead of the data saved in config
- Remove some "dead" Layout Builder logic in Entity View
- Remove
DisplayBuilderViewsManager
."
Remaining:
- Fix regressions
- Fix PHP Stan
- Remove DisplayBuilderEntityViewDisplayStorage ?
Folllow-up issue:
- Rename
EntityWithDisplayBuilderInterface
toWithDisplayBuilderInterface
- Merge
StorageProperties
enum to static constant inConfigFormBuilder
?
- Implement
- 🇫🇷France pdureau Paris
Let's keep this issue and MR only for Views integration and the rest move there: 📌 Implement WithDisplayBuilderInterface in Entity View Active
- 🇫🇷France pdureau Paris
Everything done.
Follow-up: 📌 WithDisplayBuilderInterface follow-ups Active
- 🇫🇷France mogtofu33
Fresh install with ui_patterns 2.0.5
- Apply Patch https://www.drupal.org/project/display_builder/issues/3534215#comment-16... 📌 Align config storage properties & mechanisms Active
- Enable the module display_builder_views
- Disable css/js, render cache, twig cache
Problem : All views are overridden and there is no fallback to regular view
Quick investigation, the display_builder variable in the view templates can have an empty #cache array
First set of tests:
- Create a new test view for article and page
- Set a display builder
- Save
- Edit the Builder and add a token and views rows, note: I don't see the DB plugin '[View] Rows' but the UI patterns source 'Views rows'
> Visit the page, error UI Patterns (probably because of source plugin being the one from UI Patterns.
Error: Call to a member function getOption() on null in Drupal\ui_patterns_views\Plugin\UiPatterns\Source\ViewsSourceBase->getViewsFieldOptions() (line 99 of modules/contrib/ui_patterns/modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsSourceBase.php). Drupal\ui_patterns_views\Plugin\UiPatterns\Source\ViewRowsSource->getPropValue() (Line: 206) Drupal\ui_patterns\SourcePluginBase->getValue() (Line: 166) Drupal\ui_patterns\Element\ComponentElementBuilder->buildSource() (Line: 55) Drupal\display_builder_views\Hook\PreprocessViewsView->preprocessViewsView() (Line: 367)
Create a new view and create DB with not default config, for example devel config,
If Enable on a view a display builder > save, then edit and change configuration for devel, same error:Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("view", "display") to generate a URL for route "display_builder_views.views.manage". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 189 of core/lib/Drupal/Core/Routing/UrlGenerator.php). Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute() (Line: 310) Drupal\Core\Routing\UrlGenerator->generateFromRoute() (Line: 105) Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute() (Line: 773) Drupal\Core\Url->toString() (Line: 37) Drupal\display_builder_devel\Plugin\display_builder\Island\OperationButton->build() (Line: 393) Drupal\display_builder\Entity\DisplayBuilder->buildPanes() (Line: 165) Drupal\display_builder\Entity\DisplayBuilder->build() (Line: 68) Drupal\display_builder_views\Controller\ViewsController->getBuilder()
If Display builder is enabled on a view, and the view not saved, if click on the view on the Display builder > build display, this redirect to 'Page not found'
> Expected: If there is a link and the builder appear in 'Views builder', should be able to edit itCan not edit a display from 'Display builders in Views' (/admin/structure/views/display_builder), so cannot change the configuration
If Builder deleted from 'Display builders in Views' (/admin/structure/views/display_builder), still set in the viewsWhen enabled display should we have the default views zone field set to not start empty?
When add a display builder in a view, schema error:
Schema errors for views.view.content with the following errors: views.view.content:display.page_1.display_options.display_extenders.display_builder.sources missing schema.
- 🇫🇷France pdureau Paris
Thanks a lot for the detailed review.
Edit the Builder and add a token and views rows, note: I don't see the DB plugin '[View] Rows' but the UI patterns source 'Views rows'
I will have alook.
If Display builder is enabled on a view, and the view not saved, if click on the view on the Display builder > build display, this redirect to 'Page not found'
> Expected: If there is a link and the builder appear in 'Views builder', should be able to edit itI will have a look.
When enabled display should we have the default views zone field set to not start empty?
It is already the case with this I believe:
public function initInstanceIfMissing(): void { ... // Get the sources stored in config. $sources = $this->getSources(); if (empty($sources)) { // Fallback to a fixture mimicking the standard view layout. $sources = DisplayBuilderHelpers::getFixtureDataFromExtension('display_builder_views'); } $this->stateManager->create($instance_id, (string) $this->getDisplayBuilder()->id(), $sources, $contexts); }
But the fixture is added to the State Maanger instance only and you need to save the Display Builder to have it in config. It works the same for 📌 [1.0.0-beta1] Add proper page management Active and 📌 Implement WithDisplayBuilderInterface in Entity View Active . Do you want to save it in config directly?
- 🇫🇷France pdureau Paris
Hi Jean,
- 5 issues fixes.
- 2 issues not reproduced
- 1 issue abit confusing to me:
Error: Call to a member function getOption()
. Let's check that together?
- 🇫🇷France pdureau Paris
Follow-up 📌 2 mysterious fatal errors with Views Active