Jump to content
Hotclutch

Undefined constant in cm_header_logo.php

Recommended Posts

In cm_header_logo.php and cm_header_breadcrumb.php you have

 

$this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; 

 

where is MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION defined?

Share this post


Link to post
Share on other sites

Thank you, I am using an edge version downloaded maybe a month or two ago, so must have missed an update then.

Share this post


Link to post
Share on other sites

Actually it is there - in the Admin English file. I am using an error checker (FWR) and for some reason it wants it on the catalog side - if anybody else sees the same.

Share this post


Link to post
Share on other sites

Yeah, I have it turned off now, shop is error free. Noticed something else while running Google pagespeed test, which makes me wonder if only I can see the debugging output like it's supposed to be. To be fair that code needs to be updated, was not meant to run on this new version of osCommerce.

Share this post


Link to post
Share on other sites

Yeah, I have it turned off now, shop is error free. Noticed something else while running Google pagespeed test, which makes me wonder if only I can see the debugging output like it's supposed to be. To be fair that code needs to be updated, was not meant to run on this new version of osCommerce.

 

My mistake! Neglected to RTFM  :D

 

  /**
  * KISS_ERROR_REPORTING_GET_SWITCH is to protect a live site from showing errors to screen but still can be seen on screen by the developer
  * KISS_ERROR_REPORTING_GET_SWITCH only applies when KISS_ERROR_REPORTING_OUTPUT is set to screen
  * If KISS_ERROR_REPORTING_GET_SWITCH is set as 'false' errors and all other output will always be printed to screen.
  * If KISS_ERROR_REPORTING_GET_SWITCH is set anything other than  'false', ( e.g. fwroutput ) output to screen will only occur if the value is in the querystring as a key
  * e.g. www.mysite.com/index.php?fwroutput 
  */

Share this post


Link to post
Share on other sites

Actually it is there - in the Admin English file. I am using an error checker (FWR) and for some reason it wants it on the catalog side - if anybody else sees the same.

 

I can confirm this is the case on a new installation with the module installed.  The constant MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION is only in admin/includes/languages\english.php

 

$this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>';

 

This contant is listed in the following files:

 

cm_header_breadcrumb.php

cm_header_buttons.php

cm_header_logo.php

 

It appears to be warning meant for the Admin Content Module page.  (1) Logic can be added to only have this appear when in Admin or (2) the following line needs to be added to the catalog/includes/languages/english.php or (3) to each indepentent language file and a unique constant for each.

 

// bootstrap helper

define('MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION', '<p>Content Width can be 12 or less per column per row.</p><p>12/12 = 100% width, 6/12 = 50% width, 4/12 = 33% width.</p><p>Total of all columns in any one row must equal 12 (eg:  3 boxes of 4 columns each, 1 box of 12 columns and so on).</p>');

 

Thoughts on how we should address this?  I lean toward option 3 as it allows the module to be indepentent.

Edited by marcello

Share this post


Link to post
Share on other sites

This contant is listed in the following files:

 

cm_header_breadcrumb.php

cm_header_buttons.php

cm_header_logo.php

 

Missing from cm_header_search.php (though it should be listed).  Would need to add

 

$this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>';

Share this post


Link to post
Share on other sites

Adding the definition to the language file on the catalog side will clear the error. Another solution may be to move the modules onto the Admin side, as at the moment the CONSTANT lies on the catalog side but the definitions are to be found on the Admin side.

Share this post


Link to post
Share on other sites

Yes. This is the easiest fix; however, it depends on how the core team wants the code to function.  From what I have read, it would appear that my suggested option #3 would fit in best with the module concept that the core team is aiming to acheive.  Even if it creates redundant text throughout multiple files.

Share this post


Link to post
Share on other sites

Yes. This is the easiest fix; however, it depends on how the core team wants the code to function.  From what I have read, it would appear that my suggested option #3 would fit in best with the module concept that the core team is aiming to acheive.  Even if it creates redundant text throughout multiple files.

 

Your suggestion 2 and 3 is the same, add a definition to the language file(s) catalog side. There's a bug reporting tool somewhere on the forum, if you want to draw the core team's attention to it.

Share this post


Link to post
Share on other sites

#2 was to create one entry in the english.php file.

#3 was to create an entry in each of the content module language files with a unique constant.

 

I created a github based on #2 as it was the easiest and I added the Bootstrap Row Description to all other modules that contain the Content Width field.  This way it is easy to see and understand when looking over each module from the Admin side.

 

This is just a minor issue and I'll leave it to the team to decide if they want to integrate the suggested changes.

Share this post


Link to post
Share on other sites

Read and understand the post of @@wHiTeHaT above.

 

This is unused in the shop side.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

Correct.  The constant is not used for display on the Shop side; however, when the module is loaded on the shop side, this error is generated.  The additon of this constant to english.php on the shop side can be null.  Or as I mentioned, with option #3 each module can have it within its own language file.  The following are just examples of how each module could have it's own:

 

cm_header_breadcrumb.php => MODULE_CONTENT_HEADER_BREADCRUMB_BS_ROW_DESCRIPTION

cm_header_buttons.php => MODULE_CONTENT_HEADER_BUTTONS_BS_ROW_DESCRIPTION

cm_header_logo.php => MODULE_CONTENT_HEADER_LOGO_BS_ROW_DESCRIPTION

 

Again, only a suggestion.  It is a non-critical error that should be clean up.  Open to helping out with whichever method the majority feels best.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×