Jump to content
  • [Beta4] BadMethodCallException: NO_TEMPLATE_FILE - wrong case for template file name


    Hello,

    Running in IN_DEV=true mode...

    I created a database template in the following folder:

    /home/bn2468/public_html/applications/cms/dev/html/database/holiday_featured_records

    I then clicked "Import Developer Templates" and this created a template within the ACP that I could view with name "Holiday Featured Records" (that is replacing all underscore with spaces and uppercasing the capital letters).

    I then attempted to use the template with a database and when viewing the index page received the error:

    BadMethodCallException: NO_TEMPLATE_FILE - /home/bn2468/public_html/applications/cms/dev/html/database/Holiday_Featured_Records/index.phtml

    As you can see from the above, the changes to the name implemented by the "Import Developer Templates" button was not correctly reversed when using the template in IN_DEV mode.

    1. The spaces in "Holiday Featured Records" were correctly replaced with underscores.
    2. But, the uppercase capital letters were not lowercased as they should have been...

    Thanks.

    John


    User Feedback

    Recommended Comments

    Esther E.

    Posted

    I can't reproduce this.

    If I import my dev templates the way you're describing, then they don't show up as an option in the database form (that's a separate issue, I'll get back to that). When I allow them through (by modifying the code to allow it), then they show up just fine and with the correct path.

    So let's start with the first question, how are you assigning the template to a database?

    BN_IT_Support

    Posted

    Hi Esther,

    Thanks very much for your response.

    Argh!

    I made the report under Beta4 and am now running Beta5. Also, I cannot remember precisely what I did under Beta4 -- at the time it appeared to me to be an entirely normal sequence (nothing strange like zapping the database directly, for example), but it is entirely likely that when I imported the template it actually updated an existing template. In short, "something has changed" -- either a change between Beta4 and 5 or else the sequence being used to reproduce the problem. My thought is to move forward from where we are rather than worry about something that I can no longer reproduce.

    What I have done...

    1. Copied the files/folders under applications/cms/dev/html/database/display to display_test_weir
       
    2. In the ACP clicked 'Import Developer Templates' - this imported the template but as you said it does not offer it when you attempt to select a template under the ACP edit database.

      The issue is that importing the templates as above does not set the 'template_original_group' to one of the allowed values (category_index, listing, display, form) so when you edit a database the ACP does not know where to offer the new template group.

      This is a bug in its own right. I'd be happy to log a separate bug report if required, but you seem to be onto this one anyway!
       
    3. SQL: update `cms_templates` set template_original_group = 'display' where template_original_group = 'display_test_weir'; to work around the above bug and make the template group visible in the ACP.

      At that point I was able to set the template but display worked OK so the original problem could not be reproduced.
       
    4. There is an additional bug that showed up while I was poking around to investigate this problem - please let me know if you want me to log a new bug (or will you just pick it up from here?)...

      There are scenarios where editing a template (in the ACP) can lose template_original_group from the record in cms_templates. When this happens the option to 'compare with default' no longer works. I have done three tests and only one of these failed:

      OK: Edit a single line in 'reviews' and save -> compare with default works OK

      OK: Delete all content from 'comment' and save -> compare with default works OK

      Fail: Copy all content from 'reviews' and paste into 'recordEditLine' and save -> compare with default shows the default as empty (i.e. not the original)

    Thanks very much.

    John

    Esther E.

    Posted

    If you don't mind putting in 2 separate bug reports, I'd appreciate it. Just helps me keep track of things better. Thank you!


×
×
  • Create New...