Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It appears #1820442: Panelizer for Comments introduced a bug where the path to 'admin/structure/types/manage/%/panelizer' is inaccessible. Users receive a 403 error (even user1). When the patch from comment #4 from #1820442: Panelizer for Comments is applied to 7.x-3.1, the bug described by this issue manifests itself.
The bug is also observable by upgrading to revision 'a75c0e5bb05d1cbb2bc9f3c06569fb2ebcea3c5c' (Issue #1820442 by dixon_: Panelized comments.)
Comment | File | Size | Author |
---|---|---|---|
#17 | panelizer-n2206155-17.patch | 1 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaDid you have the Comment module enabled? If not, please try downloading the latest -dev snapshot again.
Comment #2
Chris Burge CreditAttribution: Chris Burge commentedThe Comment module is enabled. Disabling it has no effect.
I'm using a brand-new Drupal install (7.26) with the 'Standard' install profile. The issue persists in the '7.x-3.x' branch as of commit 104488cb91da2c28d03ae80aff46fc5978238650 (Issue #1965148 by DamienMcKenna, fago, das-peter: Don't save records for default...)
Comment #3
Chris Burge CreditAttribution: Chris Burge commentedComment #4
DamienMcKennaI've just committed another fix for the comments integration, does it still happen?
Also, what user account are you using? User 1 or another one?
Comment #5
DamienMcKennaOk, scrap that, I reread your original request and you are using user 1. Drat.
Comment #6
Chris Burge CreditAttribution: Chris Burge commentedCommit 89c91da764f1824d5d3c7febd2f602eeab620aae doesn't appear to modify the behavior described by this issue.
The issue is related to the new 'PanelizerEntityComment' class. Line 13 in 'plugins/entity/PanelizerEntityComment.class.php' is of interest because this is the same path reported by this issue:
When I modify line 13, the symptom described by this issue is no longer present; however, I don't know how resolve this issue in a way that doesn't break the new Comment functionality.
Line 17 from 'plugins/entity/PanelizerEntityNode.class.php' may be instructive:
17 public $entity_admin_root = 'admin/structure/types/manage/%panelizer_node_type';
Comment #7
DamienMcKennaThanks for the sleuthing. Does this resolve the problem?
Comment #8
DamienMcKennaI've committed this, thanks for the sleuthing, Chris!
Comment #9
Chris Burge CreditAttribution: Chris Burge commentedThis issue remains unresolved. I don't believe line 13 is necessary:
plugins/entity/PanelizerEntityComment.class.php
I dug a little deeper into plugins/entity/PanelizerEntityDefault.class.php:
The Comments entity type doesn't have an admin UI where Panelizer tabs would be added, correct?
Further, when line 13 is included, there is undesired behavior:
Comment #10
Chris Burge CreditAttribution: Chris Burge commentedPatch to remove '$entity_admin_root' from 'PanelizerEntityComment.class.php'
Comment #11
DamienMcKennaA few things: have you enabled Panelizer for comments on any content types? Have you enabled Panelizer for any content types themselves? What version of PHP are you using?
Comment #12
DamienMcKennaOut of interest, does this solve the problem?
Comment #13
DamienMcKennaI thought I'd uploaded this already, evidently not.
Comment #14
DamienMcKennaFYI the patch in #13 just removes the $entity_admin_root and $entity_admin_bundle values completely.
Comment #15
Chris Burge CreditAttribution: Chris Burge commentedThe patch from #12 doesn't appear to have an affect on the symptoms described by this issue. It does result in a new error, however:
Warning: str_replace() expects at least 3 parameters, 2 given in PanelizerEntityComment->add_admin_links() (line 88 of /var/aegir/platforms/cu_platform_2-x_5/sites/example.com/modules/panelizer/plugins/entity/PanelizerEntityComment.class.php).
The patch from #13 corrects the symptoms described by this issue.
Comment #16
DamienMcKennaAre you saying that the patch in #13 resolves the main problem of the 'admin/structure/types/manage/%/panelizer' paths being inaccessible, or it just removes the 'str_replace' bug I left in #12?
Comment #17
DamienMcKennaUpdated to disable 'admin_paths' in commend.inc.
Comment #18
DamienMcKennaNeed to fix this.
Comment #19
Chris Burge CreditAttribution: Chris Burge commentedRegarding #16, I tested patch #12 and patch #13 independently. Should I be testing with both patches being applied successively (with patch #17 replacing #13)?
Comment #20
DamienMcKennaStep #1: Download the latest -dev release.
Step #2: Apply patch #17.
Let me know how it goes. Thanks!
Comment #21
Chris Burge CreditAttribution: Chris Burge commentedI downloaded the latest dev release and applied patch #17. Testing was successful. Thanks.
Comment #23
DamienMcKennaThanks for the help fixing this, Chris! I've committed the patch.