Template Error - Block Template Error - Block
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Template Error - Block

Started by H_Krix, June 19, 2006, 05:56:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

H_Krix

Please allow me to preface this inquiry by saying that I did read the above sticky, and it did answer my question to the extent that I believe I know what is wrong. However, I have run into a rather large roadblock with attempting to fix this error.

I am currently running Coppermine version 1.4.2, hosted by a company called Siteground. In addition, Coppermine is bridged to a vBulletin board, version 3.5.4 (I don't know if this would affect anything, but i'll mention as much as possible) I'm using a skin I've downloaded from this site, called "Simplicity." There are a few alterations to the code, but they're graphical in nature (I did add a link to the main menu, and changed the text in another link as well. I did NOT change the "BLOCK_ID" which was mentioned in the Sticky. Further, I did not alter the Admin menu code at all)

You can find the site here: www.ancientcirclels.com/gallery

Upon clicking the link "User Galleries" form the homepage of the Coppermine site, the following message appears:

QuoteTemplate error
Failed to find block 'log_ecards'(#(<!-- BEGIN log_ecards -->)(.*?)(<!-- END log_ecards -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>

                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                </tr><tr>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>

                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>



For reference, the code in theme.php shows as such:



Quote// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT
                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
<!-- BEGIN admin_approval -->
                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
<!-- END admin_approval -->
                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                </tr><tr>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>


After reading the sticky posted above, as well as testing out a few things, I came to the conclusion that this error is being presented because the section of code that tells Coppermine to *not* insert a link for "log_ecards" is missing. I went into the Admin control panel, activated the feature to Log Ecards, and the error disappeared.

However, it was replaced by a similar error telling me that it was unable to locate the block 'admin_approval' (since this feature is also turned off) Further, since there were no images awaiting admin approval, activating this feature did not get rid of the error, as the button would still not be necessary.

This error only happens when attempting to access the User Galleries. All other functions of the site work flawlessly.

In attempting to narrow this issue down, I went so far as to put the "Sample" theme.php file in place of the "Simplicity" theme.php file. The same error presented itself again. I tried this with multiple other themes, and the same results followed.

Even after re-downloading the file from this site, and replacing the theme.php, style.css, and template.html files, I was met with the same error.

I've attached the Style, Theme, and Template files as .txt's, for reference. Any and All assistance would be greatly apreciated.

Thank You
-Krix


Vargha

UPGRADE to 1.4.8 current version
1.4.2 is NOT secure
Haalaa Boro Ye Chayi Vasam Dorost Kon Ta Man Ye Fekri Be Halet Bokonam ;) Ye Hendooneye Shotoriham Biyar Bizahmat :)
Visit My Site www.Rangarang.co.nr
Check Out My Gallery
www.Rangarang.co.nr/buddies
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg157.imageshack.us%2Fimg157%2F838%2Frangarang4xn.jpg&hash=48b4c3087515cafe09fc6d3f7ee19dce86328d8e)

Paver

#2
@H_Krix: Very nice error report!  That's one of the most complete ones I've seen.  Very helpful to start the support process.

Vargha is correct, but I'm not sure if that will solve your problem.  There have been some minor bug fixes along with the major fixes, but nothing that I can see that would affect this error.

In any case, that's a good first step.  If you haven't modded the core scripts at all, the upgrade should be very simple.  There are no feature changes or theme changes between 1.4.2 and 1.4.8.  (Of course a backup of files & database is always helpful before upgrades if you don't have a recent backup.)

I am concerned by this error, because there is only one place that the block 'log_ecards' is removed, and judging from your error message and your $template_gallery_admin_menu, it looks like Coppermine is trying to remove it twice.  Have you applied any mods to the core scripts or installed any plugins?

I need to try to reproduce this double-calling of the block removal function. 

A quick fix since this is an admin-thing and so having the admin toolbar show unnecessary buttons is probably acceptable is to comment out the two lines that try to extract the "log_ecards" and the "admin_approval" block, in themes/yourtheme/theme.php:
// template_extract_block($template_gallery_admin_menu, 'log_ecards');
...
// template_extract_block($template_gallery_admin_menu, 'admin_approval');

both in the function theme_admin_mode_menu.  If your theme.php doesn't have this function, copy the whole function from the sample theme and comment out the two lines listed above.

Even if this is an acceptable fix for you, I'd like to figure out why you are getting this error, if you don't mind.  It would be useful for you in the future too (for future upgrades).

edit (addition): For example, one test I'd like to see you do, if you don't mind, is to add a new category and see if that category gives the same error.  Right now, the only category you have is "User Galleries"; all your albums are uncategorized.  I'm curious if the error happens just for the User Galleries category or for any display of the index page for a category.

Sami

#3
- the problem is your "function theme_admin_mode_menu()" it's on theme.inc.php it should check first for admin mode then check for missing block (if (GALLERY_ADMIN_MODE)) but it didn't
- also the one under sample theme.php has a bug and if you are using it then you should experince this issue

1.You need to Upgrade to most recent version 1.4.8 it's mandatory
2.after upgrade if your problem exist then we can talk about it ;) (I'm sure it will be gone)

Edit:
@Dev team: check the "function theme_admin_mode_menu()" under sample/theme.php it should have if (GALLERY_ADMIN_MODE) before if ($CONFIG['log_ecards'] == 0) but it didn't.
‍I don't answer to PM with support question
Please post your issue to related board

Paver

@bmossavari:  Aha!  I missed that one.  Thanks for the information.   I am sure you are correct.

H_Krix

Much appreciated. I am currently in the midst of upgrading to 1.4.8 as we speak.

I hope this will resolve the issue, and I'll post results asap.

Sami

@Paver:you'r most welcome ;) I don't see anybody ,coding that fast ,like you
@H_Krix:I hope that Upgrade work for you
‍I don't answer to PM with support question
Please post your issue to related board

H_Krix

@Paver:

I did add a new Catagory, as you suggested, before I ran the upgrade to 1.4.8 - it was met with the same code error. (LOG_ECARDS) If there is anything else you'd like me to check out with regards to that error (provided I can still do it, after upgrading) please let me know.

@bmossavari & Vargha:

The error messages have ceased after the update to 1.4.8 - I appreciate the rapidity with which you all responded (as do the users of my site) Thank you all!

Paver

@H_Krix: Thanks for the report, but as the error was fixed by one of the bug fixes between 1.4.2 and 1.4.8, there is nothing more to troubleshoot.  Good for everyone involved!