Call to a member function getTypePlugin() on null in Drupal\scheduled_publish\Plugin\Field\FieldWidget\ScheduledPublishWidget->formElement()

Created on 16 September 2020, over 4 years ago
Updated 14 September 2024, 3 months ago

Call to a member function getTypePlugin() on null in Drupal\scheduled_publish\Plugin\Field\FieldWidget\ScheduledPublishWidget->formElement() (line 54 of /web/modules/contrib/scheduled_publish/src/Plugin/Field/FieldWidget/ScheduledPublishWidget.php)

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇪Ireland lostcarpark

    Thank you for the patch. It looks good, but I would like to see test coverage for bug fixes.

    Happy to write a test if someone could describe detailed steps to reproduce.

    Setting back to "needs work" for now.

  • 🇫🇮Finland tvalimaa

    I got this error by following steps and how i fixed it:
    - I create a new content type
    - I added existing Scheduled publish field
    - When I went node add form it gave me PHP fatal error

    Fix was:
    - I went config/workflow/workflows
    - I edit existing workflow
    - I added my a new content type to Applies by Content types settings

  • First commit to issue fork.
  • Merge request !19Resolve #3171296 "Call to a" → (Merged) created by marcoliver
  • Status changed to Needs review 11 months ago
  • 🇩🇪Germany marcoliver Neuss, NRW, Germany

    Hi!

    I created an issue fork. I took the idea from the patch and slightly expanded upon it. Mainly, instead of just not breaking the page, the widget now displays a message that the content type is not managed by a workflow.

    I then added a functional test that replicates the scenario outlined in #6 🐛 Call to a member function getTypePlugin() on null in Drupal\scheduled_publish\Plugin\Field\FieldWidget\ScheduledPublishWidget->formElement() Needs work and checks for part of that explainer text.

    I'm currently seeing an issue with the testing step phpunit (next major). It seems to me to be unrelated to the module itself, but maybe someone else has an idea here.

  • 🇮🇪Ireland lostcarpark

    Great work! Glad to see a test included.

    I'll review later today.

    The "phpunit (next major)" test won't block a merge, but gives us visibility of possible issues in D11, so could be the result of merges to the 11.x branch. I'll investigate and make sure it isn't caused by this change. If it isn't, it makes sense to merge this with the error and create a follow up issue.

  • 🇮🇪Ireland lostcarpark

    New test looks good. Verified running new test without change results in error:

    The text "Scheduled moderation is not available" was not found anywhere in the text of the current page.

    Which is expected.

    Moving to RTBC.

  • Status changed to Fixed 4 months ago
  • 🇮🇪Ireland lostcarpark

    Thanks @daniyar.seferov for the original patch, and @marcoliver for extending it and adding the test, and also for the MR.

    Thanks to everyone who tested and provided feedback.

    Merge completed and all tests passed.

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

Production build 0.71.5 2024