- 🇺🇸United States dww
I also need this. My use case is that I'd rather use Twig to define the copyright, so the year can be dynamic. E.g.:
2007-{{ "now"|date('Y') }} Whatever The Owner Is
A dynamic year is essential, since no one wants to go in and update Views config every year. 😅 However, it's impossible at the moment.
I'll probably work on fixing up the patch early this week...
Thanks,
-Derek - First commit to issue fork.
- Status changed to Needs review
9 months ago 12:58pm 29 March 2024 - 🇪🇸Spain pcambra Asturies
What @rodrigoaguilera mentions is what I thought some of the fields should be the first time I installed the module: a select or other. I've added a dependency to https://www.drupal.org/project/select_or_other → so we can leverage an existing and establish form element, I've added support for the copyright field (we might want to add additional issues for other fields), and handled the validation/form handling for elements that are the special case of _field.
I didn't want to change the module drastically, I like the _field distinction still, we might want to change it for 2.x or something, so I've added an update that changes the copyright to copyright_field, the style form should be generic enough to handle existing values as "other" from the select or other.
Ready for review, I think I need a second pair of eyes on this one :)
- Status changed to Needs work
9 months ago 7:57pm 29 March 2024 - 🇪🇸Spain rodrigoaguilera Barcelona
The code looks good to me. The only bit I am missing is some lines in the post_update that enable the new module. Or does Drupal enables dependencies automatically now?
- Status changed to Needs review
9 months ago 8:47am 1 April 2024 - 🇪🇸Spain pcambra Asturies
That's a great point @rodrigoaguilera, I've just fixed that.
- Status changed to Fixed
9 months ago 11:17am 2 April 2024 - Status changed to Needs work
9 months ago 6:55pm 2 April 2024 - 🇬🇧United Kingdom Janner
Posting this here as this appears to b related to the change introduced here and the Select (or other module.
In Views, when viewing the settings for the “Podcast RSS Feed” format settings, PHP errors are thrown.
This occurs if pointing the Copyright to a field or using the “Other” option to directly enter text.
Warning: Undefined array key "#type" in Drupal\podcast\Plugin\views\style\Rss->buildOptionsForm() (line 255 of /public_html/modules/contrib/podcast/src/Plugin/views/style/Rss.php) #0 /public_html/core/includes/bootstrap.inc(164): _drupal_error_handler_real(2, 'Undefined array...', '/...', 255) #1 /public_html/modules/contrib/podcast/src/Plugin/views/style/Rss.php(255): _drupal_error_handler(2, 'Undefined array...', '/...', 255) #2 /public_html/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(1690): Drupal\podcast\Plugin\views\style\Rss->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #3 /public_html/core/modules/views/src/Plugin/views/display/PathPluginBase.php(437): Drupal\views\Plugin\views\display\DisplayPluginBase->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #4 /public_html/core/modules/views/src/Plugin/views/display/Feed.php(303): Drupal\views\Plugin\views\display\PathPluginBase->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #5 /public_html/core/modules/views_ui/src/Form/Ajax/Display.php(74): Drupal\views\Plugin\views\display\Feed->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #6 [internal function]: Drupal\views_ui\Form\Ajax\Display->buildForm(Array, Object(Drupal\Core\Form\FormState)) #7 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array(Array, Array) #8 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(283): Drupal\Core\Form\FormBuilder->retrieveForm('views_ui_edit_d...', Object(Drupal\Core\Form\FormState)) #9 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(215): Drupal\Core\Form\FormBuilder->buildForm('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState)) #10 /public_html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}() #11 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(217): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #12 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(127): Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState)) #13 /public_html/core/modules/views_ui/src/Form/Ajax/Display.php(46): Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm(Object(Drupal\views_ui\ViewUI), 'feed_1', 'ajax') #14 [internal function]: Drupal\views_ui\Form\Ajax\Display->getForm(Object(Drupal\views_ui\ViewUI), 'feed_1', 'ajax', 'style_options') #15 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #16 /public_html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #18 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #19 /vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #21/public_html/modules/contrib/redirect_after_login/src/RedirectMiddleware.php(44): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\redirect_after_login\RedirectMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /public_html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /public_html/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(209): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /public_html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /public_html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /public_html/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #33 {main}
Warning: Undefined array key "#other_option" in Drupal\select_or_other\Element\ElementBase::addSelectField() (line 141 of /public_html/modules/contrib/select_or_other/src/Element/ElementBase.php) #0 /public_html/core/includes/bootstrap.inc(164): _drupal_error_handler_real(2, 'Undefined array...', '/...', 141) #1 /public_html/modules/contrib/select_or_other/src/Element/ElementBase.php(141): _drupal_error_handler(2, 'Undefined array...', '/...', 141) #2 /public_html/modules/contrib/select_or_other/src/Element/ElementBase.php(112): Drupal\select_or_other\Element\ElementBase::addSelectField(Array) #3 /public_html/modules/contrib/select_or_other/src/Element/Select.php(20): Drupal\select_or_other\Element\ElementBase::processSelectOrOther(Array, Object(Drupal\Core\Form\FormState), Array) #4 [internal function]: Drupal\select_or_other\Element\Select::processSelectOrOther(Array, Object(Drupal\Core\Form\FormState), Array) #5 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(1013): call_user_func_array(Array, Array) #6 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(1076): Drupal\Core\Form\FormBuilder->doBuildForm('views_ui_edit_d...', Array, Object(Drupal\Core\Form\FormState)) #7 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(1076): Drupal\Core\Form\FormBuilder->doBuildForm('views_ui_edit_d...', Array, Object(Drupal\Core\Form\FormState)) #8 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(1076): Drupal\Core\Form\FormBuilder->doBuildForm('views_ui_edit_d...', Array, Object(Drupal\Core\Form\FormState)) #9 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm('views_ui_edit_d...', Array, Object(Drupal\Core\Form\FormState)) #10 /public_html/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('views_ui_edit_d...', Array, Object(Drupal\Core\Form\FormState)) #11 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(215): Drupal\Core\Form\FormBuilder->buildForm('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState)) #12 /public_html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}() #13 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(217): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #14 /public_html/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(127): Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState)) #15 /public_html/core/modules/views_ui/src/Form/Ajax/Display.php(46): Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm(Object(Drupal\views_ui\ViewUI), 'feed_1', 'ajax') #16 [internal function]: Drupal\views_ui\Form\Ajax\Display->getForm(Object(Drupal\views_ui\ViewUI), 'feed_1', 'ajax', 'style_options') #17 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #18 /public_html/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #19 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #20 /public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #21 /vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #22 /vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #23 /public_html/modules/contrib/redirect_after_login/src/RedirectMiddleware.php(44): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\redirect_after_login\RedirectMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /public_html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /public_html/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(209): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /public_html/core/modules/ban/src/BanMiddleware.php(50): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /public_html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /public_html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #33 /public_html/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #34 /public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #35 {main}
Drupal: 10.2.4
PHP: 8.1.27
Podcast (using Views): 8.x-1.9
Select (or other: 4.1.0 - Status changed to Fixed
9 months ago 9:23am 3 April 2024 - 🇪🇸Spain pcambra Asturies
Those are warnings, not errors, I'll open a separate task for these
Automatically closed - issue fixed for 2 weeks with no activity.