CMS MADE SIMPLE FORGE

CGFeedback

 

[#5976] Incompatibility in templates with NMS

avatar
Created By: Mathieu Muths (airelibre) (airelibre)
Date Submitted: Mon Jan 10 12:26:27 -0500 2011

Assigned To: Robert Campbell (calguy1000)
Version: 1.2.1
CMSMS Version: None
Severity: Minor
Resolution: Won't Fix
State: Closed
Summary:
Incompatibility in templates with NMS
Detailed Description:
Hi,

I'm using NMS and CGBlog with CGFeedback.

While trying to use the default CGFeedback templates, the messages list doesn't
display because of the test :
{if isset($message)}
  <div class="pagemessage">{$message}</div>

The problem is that the module NMS (used on the same pages) creates the
"message" var, which conflicts with the "message" var from CGFeedback.

Thanks,


History

Comments
avatar
Date: 2011-05-06 14:16
Posted By: rob (ruppon)

Hi

I've just faced with exactly the same issue, NMS 2.3.2. The problem is also with
the "error" variable.

I solve both doing some smart "find & replace" inside NMS' sources.

1. Inside .php files:
Replace <'error'> with <'error_nms'>.
Replace <'message'> with <'message_nms'>.

Modified 22 files in total.

2. Inside .tpl files:
Replace <$error> with <$error_nms>.
Replace <$message> with <$message_nms>.

Modified 9 files in total.

And also you need to change <$message> to <$message_nms> in your settings'
templates.

Hope this wll help.

Cheers
Rob

      
avatar
Date: 2011-05-11 10:19
Posted By: Mathieu Muths (airelibre) (airelibre)

Hi Rob,

Thanks for the Tip. Sure, this is the faster solution

It'll be useful to change those variables names directly in the module original
source code ;) Is it possible Calguy in a future version ?

Thanks !
      
avatar
Date: 2013-02-28 18:35
Posted By: Robert Campbell (calguy1000)

Lots of modules use the {$error} and {$message} variables.
if you are getting conflicts the best way to handle this is to 'unset' the
conflicting variables at the bottom of the first template.

You would need a UDT called 'clear_assign' with contents like:

if( isset($params['var']) ) {
  if( is_string($params['var']) ) {
    $params['var'] = explode(',',$params['var']);
  }
  $smarty->clear_assign($params['var']);
}

Call it like:  {clear_assign var='error,message'}


      
Updates

Updated: 2014-08-23 11:15
state: Open => Closed

Updated: 2013-02-28 18:37
resolution_id: => 8
cmsms_version_id: => -1