Content lock not correctly checking for valid link template

Created on 25 August 2020, almost 4 years ago
Updated 16 April 2024, 2 months ago

Problem/Motivation

When content-lock enabbled for paragraphs and edit a paragraph with paragraphs_edit module than on saving the paragraphs-edit form there is an error:
No link template 'canonical' found for the 'paragraph' entity type

Steps to reproduce

enable content-lock for paragraphs
enable paragraphs_edit module
edit a paragraph from paragraphs_edit module by link in single view (will open separate form for editing that specific paragraph )
save the paragrap
changes do get saved but with an error "No link template 'canonical' found for the 'paragraph' entity type"

Proposed resolution

putting a condition on content_lock_form_submit to redirect to url only if canonical url is there

other modules with same error : eg - https://www.drupal.org/project/html_field_formatter/issues/3008915

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India shubhangi1995 GURGAON

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • 🇺🇸United States smustgrave

    A number of changes seemed to fix several previous issues with things not locking

    Can someone verify if this is still a problem?

  • Pipeline finished with Success
    3 months ago
    Total: 233s
    #130984
  • 🇺🇸United States smustgrave

    Not sure how to test this one but the additional check makes sense I believe.

  • Status changed to Needs review 3 months ago
  • 🇺🇸United States smustgrave

    Hiding patch as I converted to an MR. Didn't need the == TRUE part.

  • First commit to issue fork.
  • Status changed to Needs work 3 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    It would be great to add a test for this using the modules mentioned in the issue summary.

    Also I think the fix is wrong. I pushed up what I think the fix should look like.

  • 🇺🇸United States jamesini Tacoma, Washington

    I applied the patches provided by Merge Request 43 from Comment #10 and it resolved the issue -- i.e. after making an edit to a Paragraph using the Paragraphs Edit module, the Content Lock module correctly redirects the user back to the ultimate parent node.

    Thanks, and well done @alexpott!

    -James

Production build 0.69.0 2024