When I edit a menu link I after I've enabled domain access support for that specific menu I get an empty fieldset with no domains available.
The following error shows:
Notice: Undefined index: widget in Drupal\domain\DomainElementManager->disallowedOptions() (line 130 of modules/contrib/domain/domain/src/DomainElementManager.php).
Drupal\domain\DomainElementManager->disallowedOptions(Object, Array) (Line: 59)
Drupal\domain\DomainElementManager->setFormOptions(Array, Object, 'field_domain_access') (Line: 47)
domain_menu_access_form_menu_link_content_form_alter(Array, Object, 'menu_link_content_menu_link_content_form') (Line: 501)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'menu_link_content_menu_link_content_form') (Line: 830)
Drupal\Core\Form\FormBuilder->prepareForm('menu_link_content_menu_link_content_form', Array, Object) (Line: 272)
Drupal\Core\Form\FormBuilder->buildForm('menu_link_content_menu_link_content_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Modules installed:
Domain access: 8.x-1.0-alpha11
Domain Country Path: 8.x-1.0
Comments
Comment #2
hbensalem commented+1 following
Comment #3
yivanov commented+ 1
This practically makes the module not usable.
Comment #4
yang.wilby commented+1, I have the same problem
Comment #5
juliakoelsch commentedSame here. My version of the Domain module is 8.x-1.0-alpha13, exact same issue.
Comment #6
lukasss commentedFor this reason, we can say that the module does not work at all!!!
Comment #7
pifagorDo you have problem on 8.x-1.0-alpha2 version?
Comment #8
pifagorComment #9
lukasss commentedyes and 8.x-1.x-dev also...
Comment #10
pifagorcan you write all the dependencies and step-by-step instruction to reproduce the problem?
Comment #11
juliakoelsch commentedI am able to reproduce on a https://simplytest.me/ site with the Domain Access and Domain Menu Access Modules:
After launch, install these modules:
* Domain
* Domain Access
* Domain Alias
* Domain Alpha Updates
* Domain Configuration
* Domain Content
* Domain Menu Access
After module installation, configure 2 domains in Domain Records settings. Go to Domain Menu settings, select Main Navigation menu.
Create a node assigned to one domain, adding that node to the main menu. Go to Structure -> Menus -> Main Navigation -> Edit the newly added link. The PHP notice detailed in the issue is in the Recent Messages log, and no domains appear in the "DOMAIN" block of the edit link page.
Comment #12
andypostVery probably that caused by missing default form display for menu link
core.entity_form_display.menu_link_content.menu_link_content.defaultComment #13
mykhailo.levchenko commentedDoes someone have any news about this issue?
Comment #14
lukasss commented#12 work for me
Comment #15
pifagorHello @lukasss.
If you tested the method of solving the problem, would be grateful if you added the patch.
Comment #16
andypostJust add form display for menu link entity, basically you need to add the file I pointed in #12
Comment #17
mykhailo.levchenko commentedHi @andypost,
Could you please tell me where exactly I need to do this?
Comment #18
christian le fournis commentedI would be also interested to know where exactly to copy the file.
Comment #19
lukasss commentedjust import this:
in core.entity_form_display.menu_link_content.menu_link_content.default
Here: .../admin/config/development/configuration/single/import
Comment #20
christian le fournis commentedThank you Lukasss !!
Comment #21
christian le fournis commentedI imported the configuration but I still can't see any option under the menu setting?
Comment #22
lukasss commentedHave you tried to reset the cache?
Comment #23
christian le fournis commentedIt's working now, thank you.
Comment #24
erik.johansson commentedMy fieldset is still empty after importing the config and clearing the cache. @extrem94 how did you solve this issue?
Comment #25
arulraj commentedMy Fieldset is still empty after doing the all the procedure.
How to resolve this issue?
Comment #26
davps commented@Erik.Johansson, @arulraj follow the steps below:
drush pmu domain_menu_access -ydrush en domain_menu_access -ydrush crConfig import solve this issue, but it would be better to provide more flexible workaround.
As described before, menu_link_content hasn't UI to manage fields (Form Display) and part of code in domain_access_confirm_fields function wasn't executed:
Comment #27
erik.johansson commented@davps I can confirm that I got the module to work after I followed your steps in a clean installation. Thanks!
Is it a possible solution to set the domain_access form widget to checkboxes so that we don't have to import config in order for the module to work. The module is pretty much broken as it is now.
Comment #28
davps commented@Erik.Johansson I'm working on it. I'll try to make patch asap.
Comment #29
d.novikov commentedIf nothing helps, try to run
drush dreafter configuration import from #19. It resolved the issue for me.Comment #30
hydra commentedYou might need to add the domain_access fields to the menu item
At /admin/structure/menu/manage/main/fields I was missing these fields
Comment #31
sorabh.v6I can see the domains list after #19 but that does not work.
I added a new link in the menu and selected one domain only for that link. But I can see that link on all domains.
@Hydra I cannot manage fields for menu, how are you able to add?
I am using Drupal 8.6.4
Comment #32
hydra commented@sorabh.v6 If you can see the domain list at the menu link, you don't have the issue described here! Lucky you :)
It sound like you still need to replace the menu block. Domain menu access provides a custom menu block as far as I remember - the drupal default menu block does not respect the access settings set by the module.
Comment #33
sorabh.v6@Hydra Thanks for the reply, I can see the block after clearing cache. And the domain menu access is working for me.
Comment #34
davps commentedThis patch contains test which should failed, because domain access fields couldn't be installed for menu links
Comment #35
davps commentedThis patch contains fixes and test should passed.
Comment #36
davps commentedNeed to re-roll tests when they will be added for 8.x-1.x branch.
I'll appreciate for reviews and manual testing.
Comment #38
pifagor