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.
Using hook_ctools_content_subtype_alter(), or in the case of blocks, hook_ctools_block_info(), to alter the "render last" behavior has no effect since it is only run on rendering, and not during the prepare step.
Comment | File | Size | Author |
---|---|---|---|
#7 | panels-subtype_alter_hook_not_run_early_enough-1669908-7.patch | 977 bytes | acrollet |
#1 | panels-1669908-1.patch | 673 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettSee attached.
Comment #2
tim.plunkettThe first thing ctools_content_get_subtype() does is call ctools_get_content_type(), and then it goes on to call all of the rest of the hooks and alters.
Comment #3
larowlanWorks for me
Allows facet api blocks to appear above search api search results.
tim.plunkett++
Comment #4
setvik CreditAttribution: setvik commentedworks here as well
Comment #5
nbucknor CreditAttribution: nbucknor commentedworks for me too
Comment #6
acrollet CreditAttribution: acrollet commentedThis patch meets the intended purpose, however it breaks the render order for at least the node edit general form plugin. Looking to see if I can find a resolution.
Comment #7
acrollet CreditAttribution: acrollet commentedAttaching a patch that follows the approach in #1, but only when the pane type and subtype don't match, on the theory that hook_ctools_content_subtype_alter() and hook_ctools_block_info() will only be used when there is a specific subtype. I don't know if this theory is valid, so it needs review from someone more intimately familiar with the whole system. I do know that this patch works for the use case of needing the facetapi blocks to render last on display, (ref: #1669918: Allow Panels to properly use Facet API blocks) without hosing the node edit general form. In my limited testing thus far, this approach does not appear to break anything else.
Side note: to reproduce the problem with the node general form, apply the patch in #1 and use page manager to override the node edit form. Place the general form element first, and a field (e.g. body, tags) after it. The general form will not be rendered last as it should, leading to a notice about the field element not existing in the form array, and the edit panel will not be displayed as expected.
Comment #8
tim.plunkettOh, this makes a lot more sense.
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted #7.
Comment #12
kopeboy CreditAttribution: kopeboy commentedIs this included in a stable release too?
(I cannot get Facets to work with Panels when using a Search API View Content Pane with contextual filter
Comment #13
kopeboy CreditAttribution: kopeboy commentedComment #16
acrollet CreditAttribution: acrollet commentedThis code was committed 2 years ago, and 1.4 was released this year. Please search for help in forums/IRC/stackexchange, or at worst open a support request rather than re-opening old fixed issues.