Remove getActionTarget() as it isn't a private function anymore and can be inherited

Created on 29 June 2023, over 1 year ago
Updated 9 January 2024, 10 months ago

Problem/Motivation

Remove getActionTarget() as it isn't a private function anymore and can be inherited.

Steps to reproduce

Proposed resolution

Remove getActionTarget() as it isn't a private function anymore and can be inherited.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grevil
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    2 fail
  • @grevil opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany Grevil

    Done, please review!

  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Grevil

    New error, when listing terms:

    Error:
    Call to a member function setOption() on string

    at /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php:203
    at Drupal\Core\Entity\EntityBase->toUrl()
    (/var/www/html/web/core/modules/taxonomy/src/Form/OverviewTerms.php:358)
    at Drupal\taxonomy\Form\OverviewTerms->buildForm(array('#attributes' => array('class' => array('taxonomy-overview-terms')), '#first_tid' => '1', 'help' => array('#type' => 'container', 'message' => array('#markup' => object(TranslatableMarkup))), 'terms' => array('#type' => 'table', '#empty' => object(TranslatableMarkup), '#header' => array('term' => object(TranslatableMarkup), 'operations' => object(TranslatableMarkup), 'weight' => object(TranslatableMarkup)), '#attributes' => array('id' => 'taxonomy'), '#cache' => array('contexts' => array('user.permissions'), 'tags' => array(), 'max-age' => -1), 'tid:1:0' => array('term' => array(), 'operations' => array(), 'weight' => array(), '#term' => object(Term)))), object(FormState), object(Vocabulary))
    at call_user_func_array(array(object(OverviewTerms), 'buildForm'), array(array('#attributes' => array('class' => array('taxonomy-overview-terms'))), object(FormState), object(Vocabulary)))
    (/var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php:536)
    at Drupal\Core\Form\FormBuilder->retrieveForm('taxonomy_overview_terms', object(FormState))
    (/var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php:283)
    at Drupal\Core\Form\FormBuilder->buildForm(object(OverviewTerms), object(FormState))
    (/var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php:73)
    at Drupal\Core\Controller\FormController->getContentResult(object(Request), object(RouteMatch))
    at call_user_func_array(array(object(HtmlFormController), 'getContentResult'), array(object(Request), object(RouteMatch)))
    (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123)
    at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    (/var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:583)
    at Drupal\Core\Render\Renderer->executeInRenderContext(object(RenderContext), object(Closure))
    (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:121)
    at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(array(object(HtmlFormController), 'getContentResult'), array(object(Request), object(RouteMatch)))
    (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97)
    at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:166)
    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
    (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:74)
    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php:58)
    at Drupal\Core\StackMiddleware\Session->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48)
    at Drupal\Core\StackMiddleware\KernelPreHandle->handle(object(Request), 1, true)
    (/var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106)
    at Drupal\page_cache\StackMiddleware\PageCache->pass(object(Request), 1, true)
    (/var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85)
    at Drupal\page_cache\StackMiddleware\PageCache->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48)
    at Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(object(Request), 1, true)
    (/var/www/html/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php:42)
    at Drupal\tracer\StackMiddleware\TracesMiddleware->handle(object(Request), 1, true)
    (/var/www/html/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php:34)
    at Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51)
    at Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51)
    at Drupal\Core\StackMiddleware\StackedHttpKernel->handle(object(Request), 1, true)
    (/var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php:704)
    at Drupal\Core\DrupalKernel->handle(object(Request))
    (/var/www/html/web/index.php:19)

  • 🇩🇪Germany Anybody Porta Westfalica

    Has never been a private function

  • 🇩🇪Germany Anybody Porta Westfalica

    This was solved in #3095653: Split performAction() into submethods in PageRedirect Behaviour but hasn't been changed in this module since that change.

  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Changes LGTM, but re #4 are we sure this error doesn't happen without this change?

    If yes, please compare the old implementation to the one merged in #3095653: Split performAction() into submethods in PageRedirect Behaviour

  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Grevil

    We get the errors after fixing the original issue in 🐛 Using this module in Drupal 10 currently breaks the module Active .

    The problem is, that the target variable is always NULL.

  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil, but that means that error isn't introduced from the changes here?
    Then we should merge this and handle the error in the appropriate issue.

  • 🇩🇪Germany Grevil

    Yes, this indeed was never a private function, but it was called internally by our custom "CanonicalLinkModifier" and now it is called by our parents "performActions" method. I think, we could possibly remove the "CanonicalLinkModifier", this might also be the source of the new error.

    > @Grevil, but that means that error isn't introduced from the changes here?
    Then we should merge this and handle the error in the appropriate issue.

    I think the error comes from the same source, so we could possibly also merge these 2 issues into one. As they are quite similar.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    2 fail
  • Status changed to Fixed over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @Grevil, merged! Plase continue with the other issue or merge / close it, what ever is appropriate!

  • 🇩🇪Germany Grevil

    Ok, my apologies, "getActionTarget" needs to do SOMETHING different from its parent function. Otherwise, this hole module wouldn't make sense. I'll try to restore the functionality needed in 🐛 Using this module in Drupal 10 currently breaks the module Active .

  • 🇩🇪Germany Grevil

    Note on #13, it doesn't.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed 11 months ago
  • 🇬🇧United Kingdom natts London

    @Anybody This commit broke my front page on my 9site, with a similar error to #4. The commit means that PageRedirectHref has no methods, and so getActionTarget doesn't return anything.

    This commit should not have been included in v2.0.2.

    I suggest you release again (v2.0.3) with this commit reverted, and please test changes before releasing them.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @natts you're right! I'm going to revert this and afterwards we'll take a look at this implementation again. Re-assigning Grevil for that.

  • Assigned to Grevil
  • Status changed to Active 11 months ago
    • Anybody committed bb6a0796 on 2.0.x
      Revert "Issue #3371335 by Grevil, Anybody: Remove getActionTarget() as...
  • Status changed to Closed: duplicate 10 months ago
  • 🇩🇪Germany Grevil

    @natts, yes 2.0.2 should've never seen the light of day as stated in 🐛 Using this module in Drupal 10 currently breaks the module Active :

    Ok, just created the test! I will now assign this to @Anybody, to see if he can fix the issue!

    Setting this to CRITICAL, as the current dev version is broken for Drupal >= 9.5.8.

    Note, that as a final Attempt tried to revert everything to the state before #3371335: Remove getActionTarget() as it isn't a private function anymore and can be inherited, to see if the old "getActionTarget()" implementation would make a difference. But unfortunately not. At some point, it became illegal to remove the "canonical" link.

    This wasn't very well communicated by me here:
    - No proper issue summary
    - No reference to the parent issue
    - Confusing comments

    My apologies.

    Let's keep this issue closed and see if we can get it Drupal 10 ready, while keeping the backwards compatibility to D9 in 🐛 Using this module in Drupal 10 currently breaks the module Active .

Production build 0.71.5 2024