drupal-fancy / view_mode_selector Goto Github PK
View Code? Open in Web Editor NEW:rainbow: Contains the View Mode Selector module for Drupal.
Home Page: https://drupal.org/project/view_mode_selector
:rainbow: Contains the View Mode Selector module for Drupal.
Home Page: https://drupal.org/project/view_mode_selector
We should add an option to let the user override the label of a view mode, maybe only for default - that would make sense.
Causing fatal error such as "function sortByRegionCount already declared".
Suggesting that we wrap function declaration in function_exists.
On view_mode_selector 7.12 with php 7.4
When editing a page that contains a view_mode_selector, we get
Deprecated function : implode(): Passing glue string after array is deprecated. Swap the parameters dans view_mode_selector_field_widget_form() (line 262 of /sites/all/modules/view_mode_selector/view_mode_selector.module).
Note this will be more critical on php 8.
When i try to include an icon of a view mode selector the system shows this warning:
Warning: foreach() argument must be of type array|object, bool given in Drupal\file\Element\ManagedFile::valueCallback() (line 150 of core/modules/file/src/Element/ManagedFile.php).
Drupal\file\Element\ManagedFile::valueCallback(Array, , Object)
call_user_func_array(Array, Array) (Line: 1277)
Drupal\Core\Form\FormBuilder->handleInputElement('field_config_edit_form', Array, Object) (Line: 1000)
Drupal\Core\Form\FormBuilder->doBuildForm('field_config_edit_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('field_config_edit_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('field_config_edit_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('field_config_edit_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('field_config_edit_form', Array, Object) (Line: 574)
Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 564)
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}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
And the icon it's not saved.
Great module!
I just miss you to choose which image style to use when you select icon mode in the field form.
Deprecation needs to be fixed to make it compatible with Drupal 9.
Deprecation List for 1.x-dev:
view_mode_selector\src\Plugin\Field\FieldType\ViewModeSelectorItem.php 83 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0
view_mode_selector\src\Plugin\Field\FieldWidget\ViewModeSelectorIcons.php 43 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\src\Plugin\Field\FieldWidget\ViewModeSelectorWidgetBase.php 32 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\src\Plugin\Field\FieldWidget\ViewModeSelectorWidgetBase.php 44 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\view_mode_selector.module 25 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\view_mode_selector.module 41 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\view_mode_selector.module 54 Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
view_mode_selector\view_mode_selector.module 82 Call to deprecated function drupal_set_message(). Deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
view_mode_selector\view_mode_selector.module 85 Call to deprecated function drupal_set_message(). Deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
I would like to offer to co maintain the module, so that we can get at least the drupal 10 integration fixed.
It would be great if there was an empty value option. This way it can be the "default" which is no field value.
For paragraph, this shows always the default view mode.
I'm creating a view that takes the view_mode_selector argument from the node. The view takes the node id as a contextual filter and outputs the content to the selected style mentioned previously. See screenshot:
When I go to change the settings to how I output the content I get the following error message via ajax/javascript.
Just thought i'd post this here. Let me know if you need any more information regarding the error.
I'm getting this warning:
Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in Drupal\view_mode_selector\Plugin\Field\FieldWidget\ViewModeSelectorIcons->formElement() (line 144 of src/Plugin/Field/FieldWidget/ViewModeSelectorIcons.php)
I guess the code should be to be this to be 7.4+ compatible
$element['value']['#options'][$view_mode] = implode('', $output);
When I enable the view mode after adding the view mode field to paragraph bundle and select the view mode while creating content the node content display comes empty.
The classes of view mode are wrapped perfectly. The content area is empty.
Hello, I'm using the module with the paragraph module and for a few days I notice that the icon file disappears suddenly, then I can see that the file disappears from the database too because was saved with status = 0.
I fix it using this code
`
/**
and
`
/**
More information here
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7.x/#managed_file
Unfortunately the documentation is not really clear on how to an output / result in the frontend.
Hope I can manage that and also deliver a little documentation on this.
Cannot redeclare
View_mode_selector.module line 189
Seems like I can only add one paragraph with the View mode selector on a page. Adding a second paragraph that uses a view mode, throws an AJAX error.
This is for the latest version of the Drupal 7 module.
I can't find a css class added to the entity, when using a specific view-mode.
Need this for layout
Does it work with Custom Block? Particularly: placed via Layout Builder?
Currently the view_mode_seletor module is not compatible with entity metadata wrappers (provided by the entity module).
Adding support is easy, it's a one line change. You simply need to define 'property_type' => 'text' in the hook_field_info().
Documentation on that is here: http://www.thecarneyeffect.co.uk/describe-field-properties-make-custom-fields-work-entity-metadata-wrappers
I would like to use this module for a field of the relation module.
http://drupal.org/project/relation
Therefore I need to pick the view modes of the target entity and not of the relation.
When trying to add a new paragraphs entity to a node, I was getting an error about sortByRegionCount() being redeclared (line 189 of view_mode_selector.module). I think you need to move this function outside of view_mode_selector_view_modes(). You might also consider name spacing the function once moved to prevent collisions.
Great module!!
The forms for the preview stores a fid in the settings array.
When I deploy that to another server with features the fid is not the same.
Right now I'm solving that with a form alter wherever we show the previews but adding the ability to have a fixed path may be nice.
Thanks.
Hey guys, I tried the module on simpletest.me switching the view mode of a paragraph and it seems to work fine. Do you already have plans when to port the module to beta on drupal.org? upgrade path and so on … Would be really good to know about the maintainance situation for the future. Thanks in advance!
In some circumstances (e.g. if view_mode_selector_field_widget_form is called multiple times) the function 'sortByRegionCount' is already defined and causes a fatal errors view_mode_selector_field_widget_form.module:188ff.
Let's wrap it in a function exists call
if (!function_exists('sortByRegionCount')) {
// Sort Display Suite view modes by number of regions.
function sortByRegionCount($a, $b) {
return count($a['layout']['settings']['regions']) - count($b['layout']['settings']['regions']);
}
}
There is a patch on drupal.org/projects/view_mode_selector to be merged to make this module D10 ready. This issue is to merge this patch.
Thank you for your module. I use it on several sites and it works great. Now I need exactly same functionality on new Backdrop site, so I want to port this module to Backdrop and share with it in Backdrop-contrib.
To port your module only changing few lines of code is needed.
And I have to ask, do you guys interested in supporting a Backdrop version, or porting the module themselves?
I am using view mode selector with paragraphs module. I am trying to configure my various paragraph bundles have different view modes available (for example, I'd like to have a set of paragraphs where the author can select if they want it to be two or three columns and then use a multivalue field and then another set of paragraphs where they might have four images with a multivalue field - this part is working fine when VMS is not enabled). When VMS is enabled and I am adding additional paragraphs bundles to my content, I get an ajax error:
Fatal error: Cannot redeclare sortByRegionCount() (previously declared in
/sites/all/modules/contrib/view_mode_selector/view_mode_selector.module:189) in
/sites/all/modules/contrib/view_mode_selector/view_mode_selector.module on line 189
If I try to edit a page that I had created prior to implementing VMS, I get WSOD.
Is it possible to use this with paragraphs to specify view modes for multiple paragraph bundles within a content type? It would be nice to have only a few paragraphs bundles with many display modes available.
I am going to also look into Entity VMS, as I realize I am trying to add this to multiple entities, and that might be more appropriate.
Steps to recreate (from a fresh simplytest.me site):
Notice: Undefined index: default in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 99 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: default in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 109 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: default in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 122 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: teaser in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 99 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: teaser in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 109 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: teaser in Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm() (line 122 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldType/ViewModeSelectorItem.php).
Drupal\view_mode_selector\Plugin\Field\FieldType\ViewModeSelectorItem->fieldSettingsForm(Array, Object) (Line: 95)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Strict warning: Only variables should be passed by reference in Drupal\view_mode_selector\Plugin\Field\FieldWidget\ViewModeSelectorRadios->formElement() (line 27 of sites/default/modules/view_mode_selector/src/Plugin/Field/FieldWidget/ViewModeSelectorRadios.php).
Drupal\view_mode_selector\Plugin\Field\FieldWidget\ViewModeSelectorRadios->formElement(Object, 0, Array, Array, Object) (Line: 329)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 194)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object) (Line: 109)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 303)
Drupal\Core\Field\FieldItemList->defaultValuesForm(Array, Object) (Line: 102)
Drupal\field_ui\Form\FieldConfigEditForm->form(Array, Object) (Line: 120)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 517)
Drupal\Core\Form\FormBuilder->retrieveForm('field_config_edit_form', Object) (Line: 276)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 79)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 128)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 577)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 129)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 102)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 62)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 103)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 55)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 637)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
There is a PHP 8.0 compatibility warning thrown for
144 | WARNING | Passing the $glue and $pieces parameters in reverse order to
| | implode has been deprecated since PHP 7.4; $glue should be the
| | first parameter and $pieces the second
--------------------------------------------------------------------------------**
Problem/Motivation
I add the field view mode selector to an existing paragraph used in the website, then when i edit an existing paragraph it does not let me edit it, however if I create a new paragraph of this type in the node I can create it.
The PHP notice is
Notice: Only variables should be passed by reference in /view_mode_selector/src/Plugin/Field/FieldWidget/ViewModeSelectorRadios.php on line 27
Proposed resolution
Split $items[$delta]->value ?: reset(array_keys($this->viewModes)),
in two variables to avoid it.
Specs
Drupal 8.6.10
PHP 7.1.26
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.