Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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?

Link to comment
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.

Link to comment
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 
  */
Link to comment
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.

Link to comment
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>';

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...