Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20451

block_view_gui for a manual fetched block don't use override templates

    Details

      Description

      If you fetch a block manually in a template with
      "$block = fetch( 'ezflow', 'block', hash( 'block_id', <BLOCK_ID>) )"

      and than afterwards using
      "block_view_gui block=$block"

      always the default "block/view/view.tpl" is used. No override rules are used.

      If you look into the block object inside a block template, you can see that this block object differs from one that you have manually fetched.

        Activity

        Hide
        Eduardo Fernandes (Inactive) added a comment - - edited

        Steps to Reproduce

        • I created a new eZ Flow block. I used Block: 2 items (Manual)
        • I duplicated the block/2_items1.tpl and named it block/2_items_test.tpl
        • I commented the original override and added my personal override for this new template

          [block_test]
          Source=block/view/view.tpl
          MatchFile=block/2_items_test.tpl
          Subdir=templates
          Match[type]=Manual2Items
          Match[view]=2_items1
          

        • I found out the block Id with an attribute show
        • In the zones/2zoneslayout1.tpl template, I added the following code

          {def $myblock=fetch('ezflow', 'block', hash( 'block_id', '3ea5afb68324c50989ac3ac64e9729c1'))}
          {block_view_gui block=$myblock}
          {undef $myblock}
          

        • I cleaned the whole cache

        The loaded template is not changed to 2_items_test.tpl

        block/2_items1.tpl	<No override>	extension/ezflow/design/ezflow/override/templates/block/2_items1.tpl
        

        Show
        Eduardo Fernandes (Inactive) added a comment - - edited Steps to Reproduce I created a new eZ Flow block. I used Block: 2 items (Manual) I duplicated the block/2_items1.tpl and named it block/2_items_test.tpl I commented the original override and added my personal override for this new template [block_test] Source=block/view/view.tpl MatchFile=block/2_items_test.tpl Subdir=templates Match[type]=Manual2Items Match[view]=2_items1 I found out the block Id with an attribute show In the zones/2zoneslayout1.tpl template, I added the following code {def $myblock=fetch('ezflow', 'block', hash( 'block_id', '3ea5afb68324c50989ac3ac64e9729c1'))} {block_view_gui block=$myblock} {undef $myblock} I cleaned the whole cache The loaded template is not changed to 2_items_test.tpl block/2_items1.tpl <No override> extension/ezflow/design/ezflow/override/templates/block/2_items1.tpl
        Hide
        Patrick Allaert (Inactive) added a comment -

        I succeeded reproducing the issue by following the description, but have no idea on how to solve this yet.
        The "Steps to Reproduce" mentioned in the first comment is wrong and does not reproduce the issue, the 2_items_test.tpl template is probably not used because of the order in which template override is defined which is not the current issue. This issue is about the override mechanism not being triggered with block_view_gui at all, so to reproduce this issue, it is the "block/view/view.tpl" template that would show up instead of "block/2_items1.tpl" or "block/2_items_test.tpl".
        To reproduce this issue, I recommend only displaying a block using

        {block_view_gui block=fetch('ezflow', 'block', hash( 'block_id', '3ea5afb68324c50989ac3ac64e9729c1'))}

        while having some existing default override rules, no need to additionally create one.

        Show
        Patrick Allaert (Inactive) added a comment - I succeeded reproducing the issue by following the description, but have no idea on how to solve this yet. The "Steps to Reproduce" mentioned in the first comment is wrong and does not reproduce the issue, the 2_items_test.tpl template is probably not used because of the order in which template override is defined which is not the current issue. This issue is about the override mechanism not being triggered with block_view_gui at all, so to reproduce this issue, it is the "block/view/view.tpl" template that would show up instead of "block/2_items1.tpl" or "block/2_items_test.tpl". To reproduce this issue, I recommend only displaying a block using {block_view_gui block=fetch('ezflow', 'block', hash( 'block_id', '3ea5afb68324c50989ac3ac64e9729c1'))} while having some existing default override rules, no need to additionally create one.
        Hide
        Patrick Allaert (Inactive) added a comment -
        Show
        Patrick Allaert (Inactive) added a comment - New PR available at: https://github.com/ezsystems/ezflow/pull/52
        Show
        Patrick Allaert (Inactive) added a comment - Fixed in: ezflow master (merge commit): https://github.com/ezsystems/ezflow/commit/bd756b1cd115be2bf2616003086871409ad41c27 ezflow master: https://github.com/ezsystems/ezflow/commit/47db424e7f480186db6c5443ef6eaca0ed689d38 ezflow 5.1: https://github.com/ezsystems/ezflow/commit/6c408bab84399816553bf7cf9abeeb33badeaad2 ezflow 5.0: https://github.com/ezsystems/ezflow/commit/c9ecb3db27c02834484521a0781b1d001fd51204 ezflow 2.5: https://github.com/ezsystems/ezflow/commit/115b8d2255dcbeb43ab456be302f37ced0b18e3e
        Hide
        Paulo Nunes (Inactive) added a comment -

        QA Approved

        Show
        Paulo Nunes (Inactive) added a comment - QA Approved

          People

          • Assignee:
            Unassigned
            Reporter:
            Eduardo Fernandes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 days, 4 hours, 10 minutes
              2d 4h 10m