Problem/Motivation

When editing default metatags the form title does not indicate which metatags are being edited. Especially when editing mulitple metatags in multiple tabs this makes it easy to do things wrong.

Steps to reproduce

  • Edit Global metatags at /admin/config/search/metatag/global
  • Edit Front page metatags at /admin/config/search/metatag/front
  • Observe that the page (form) title is always "Edit default meta tags"

Proposed resolution

Include the entity label in the page title.

Issue fork metatag-3209938

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Sutharsan created an issue. See original summary.

sutharsan’s picture

Status: Active » Needs review
damienmckenna’s picture

That's a nice improvement, thank you!

damienmckenna’s picture

Status: Needs review » Needs work

Something's strange here, a huge number of tests fail.

murilohp made their first commit to this issue’s fork.

murilohp’s picture

Status: Needs work » Needs review

Hey @DamienMcKenna, I think this is a great improvement, I didn't know if you would work on this later, but testing locally here, I found that an use statement was missed, I updated the code with this and documented the new function.

I hope I'm not doing something wrong, I haven't seen the assign to you, then I thought I could help you with that.

murilohp’s picture

I had to rebase branch 8.x-1.x into the current branch, there were some code missing and I think this will solve the testing problems.

damienmckenna’s picture

One question - what condition would lead to $metatag_defaults being NULL, and wouldn't that lead to errors being displayed because there is no label() method on a NULL object?

sutharsan’s picture

I have checked how the title callback is called and how other entity form handlers use their title callback (NodeController::addPageTitle, NodeViewController::title, CommentController::commentPermalinkTitle). I see no way the $metatag_defaults can be empty. None of the callbacks I found uses a null default value. I must have picked a bad example when I initially wrote the code.

murilohp’s picture

Thank you so much for this response @sutharsan! When I first saw this issue, I thought I could help you with the test part, do you think you can update the PR?

If you can't there's no problem, I can do it for you later.

damienmckenna’s picture

Thanks for digging through that and confirming the parameter default wasn't needed.

Just waiting for the testbot to finish.

damienmckenna’s picture

StatusFileSize
new624 bytes
new1.55 KB

The tests are failing because of a problem with core, not because of the changes in the merge request.

Let's try a patch.

damienmckenna’s picture

Status: Needs review » Fixed

Go figure.

Committed. Thank you!

Status: Fixed » Closed (fixed)

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