Needs work
Project:
Metatag
Version:
2.0.x-dev
Component:
Panels integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jul 2018 at 14:19 UTC
Updated:
3 Apr 2026 at 06:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sophiavs commentedHey, i made the first patch for this new feature. There's still some ways to improve, but for a first patch I believe this is good :)
Comment #3
damienmckennaThank you for putting that together. Let's see what the testbot says, just to be safe.
Comment #4
sophiavs commentedSorry, the last patch was missing some part of the diff.
The first patch (2988154-4-v122.patch) is a patch to apply in metatag:^1.22, and the second one (2988154-4.patch) to 8.x-1.x-dev.
Comment #5
sophiavs commentedHey, i made some changes to make the modal work right in the version 1.22.
Comment #6
sophiavs commentedI moved the hook to be inside the metatag_page_manager module and created this new patch.
It will work for both 1.22 and 8.x-1.x-dev branches.
Comment #7
vpoltronieri commentedI just added a small validation to make the metatags edit button visible only if the user has the "administer meta tags" permission.
Comment #8
damienmckennaIs the permission change useful? Do people want to require the permission be given to users who are editing Page Manager pages in order to also edit the meta tags?
Comment #9
vpoltronieri commentedThe permission is already necessary if the user wants to edit the metatags because it is the permission for the "entity.metatag_defaults.edit_form" (route used for editing the metatags in this patch).
I'm just hiding the button in case the user doesn't have permission for the route the button would direct him to. :)
Comment #10
damienmckennaOk, fair point.
Comment #11
damienmckennaI tested the patch and it needs work.
What I was envisioning would be that the Metatag configuration would show up as a link alongside "General", "Contexts", etc in the left sidebar, and would not be a link in the interior area.

Furthermore, when I clicked the link it resulted in an error in the JSON response:
Comment #12
vpoltronieri commentedMakes sense, I'll work on it.
Comment #13
vpoltronieri commentedHey Damien, the first part is going to take a little longer to implement, so now I'm going to focus on the error you encountered. I was unable to replicate this error in my local environment. Could you provide more information on how to reproduce it?NVM, I managed to replicate now.Comment #14
damienmckennaI was testing with the latest git checkouts for CTools 8.x-3.x and Page Manager 8.x-4.x, I edited the existing node view page, I added a new variant, filled in the initial dialog to give it a name, as soon as I submitted that form it gave a WSOD error because $form['wizard_tree']['#wizard'] was empty. I wrapped that in a quick if(!empty()) (forgot to upload a new patch), then was able to create the variant and get to the point I could see the link. The error logged in #11 was visible in the browser's console when I clicked the "edit" button.
Comment #15
vpoltronieri commentedHey, I'm done fixing the bug you found (and a few others I found during testing), this patch release contains these fixes.
The next step is to move the meta tags option to the correct location, as directed by you, Damien. Soon our team will work on it.
Comment #16
ivnishComment #17
ivnishI rerolled patch to 2.0 version
Comment #18
ivnishDamienMcKenna can you test it again? I don't see any problem
Comment #19
rafmagsou commentedUpdate logic came from patch #15, to prevent error regarding missing "wizard_tree" field
more details in the interdiff
Comment #20
ivnishComment #21
ivnishComment #23
ivnishComment #24
krakenbite commentedMR works for me. Please commit
Comment #25
ivnishComment #26
ivnishup!
Comment #28
damienmckennaRerolled.
Comment #29
damienmckennaImproving wording.
Comment #30
damienmckennaThis still needs some work.
I created a variant on the default "node_view" page definition and the "edit" or "add" link didn't show. I changed the code to skip the $wizzard_tree-instanceof-PageWizardBase check and the link showed, but then clicking the "add" button didn't let me define the meta tags, it showed the add-metatag-defaults form with no options on the entity bundle selector.
This means the UX needs to make it more clear what types of pages are allowed, what types are not, and the UX should adjust accordingly. While it would be complicated to link to the meta tag forms based upon the selection criteria definitions for each variant, I think links could be added for the metatag defaults definitions for the entity types, and help text needs to be included explaining what the link opens.
Comment #31
andypostWould be great to create merge request to run pipelines for regressions
Comment #32
ivnishI created MR in #22
Comment #33
dabbor commentedWhen updating
cweagans/composer-patchesto version2.0.0the patch from #29 can NOT be applied anymore, providing message:No available patcher was able to apply patch.Related reading: #3564942: composer-patches version 2 is not yet compatible with Drupal?. Composer-patches 2.x applies patches using
git applyand requires patches in git diff format.I re-created the patch from #29 using
git diffto work properly when used bygit apply.