cms_selflink directing to incorrect page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
webguru
Forum Members
Forum Members
Posts: 97
Joined: Thu May 08, 2014 6:18 pm

cms_selflink directing to incorrect page

Post by webguru »

I have the following as the cms_selflink:

<a href="{cms_selflink href='5-cities'}"><img src="uploads/images/discover/5CITIES.jpg" alt="" width="350" height="200" /></a>

The selflink was not handcoded, but through the UI. When I click on the link on the live site and even in the page preview, it goes to: index.php?page=contact-us

All the other images on the Content page are correct and linked the same way through the UI.

Anyone seen this before?

Thanks



----------------------------------------------

Cms Version: 2.1.1

Installed Modules:

AdminSearch: 1.0
CMSContentManager: 1.1
DesignManager: 1.1.1
FileManager: 1.5.2
MicroTiny: 2.0.2
ModuleManager: 2.0.1
Navigator: 1.0.2
News: 2.50.3
Search: 1.50.2
AceEditor2: 1.05
FormBuilder: 0.8.1.3
CMSMailer: 5.2.14
Captcha: 0.5.2
Showtime: 3.4
Gallery: 2.1
SimpleSiteMgr: 3.0
SimpleSiteInfo: 3.0
CGExtensions: 1.51.1
SiteMapMadeSimple: 1.2.8


Config Information:

php_memory_limit:
max_upload_size: 25000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: America/Los_Angeles
permissive_smarty: false


Php Information:

phpversion: 5.4.45
md5_function: On (True)
json_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 2048
E_DEPRECATED: 0
test_file_timedifference: No time difference found
test_db_timedifference: No time difference found
create_dir_and_file: 1
memory_limit: 96M
max_execution_time: 60
register_globals: Off (False)
output_buffering: 4096
disable_functions: show_source, symlink
open_basedir:
test_remote_url: Success
file_uploads: On (True)
post_max_size: 25M
upload_max_filesize: 25M
session_save_path: /tmp (0700)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)
check_ini_set: On (True)
curl: On


Performance Information:

allow_browser_cache: Off (False)
browser_cache_expiry: 60
php_opcache: Off (False)
smarty_cache: On (True)
smarty_compilecheck: Off (False)
smarty_cache_udt: On (True)
auto_clear_cache_age: On (True)

Server Information:

Server Software: Apache
Server Api: litespeed
Server Os: Linux 2.6.32-673.8.1.lve1.4.3.el6.x86_64 On x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 5.6.26
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable


Permission Information:

tmp: /var/www/vhtdocs/userweb64006/html/tmp (0755)
tmp_cache: /var/www/vhtdocs/userweb64006/html/tmp/cache (0755)
templates_c: /var/www/vhtdocs/userweb64006/html/tmp/templates_c (0755)
modules: /var/www/vhtdocs/userweb64006/html/modules (0755)
uploads: /var/www/vhtdocs/userweb64006/html/uploads (0755)
File Creation Mask (umask): /var/www/vhtdocs/userweb64006/html/tmp/cache (0755)
config_file: 0444

----------------------------------------------
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 173
Joined: Fri Feb 06, 2009 2:08 pm

Re: cms_selflink directing to incorrect page

Post by PinkElephant »

Looking at 2.1.2 line 67 of plugins\function.cms_selflink.php ...
if( (int)$page > 0 ) {
http://php.net/manual/en/function.intval.php
Strings will most likely return 0 although this depends on the leftmost characters of the string.
http://php.net/manual/en/language.types ... conversion
The value is given by the initial portion of the string. If the string starts with valid numeric data, this will be the value used.
... so I expect we're all seeing it when href's page alias begins with a number.
webguru
Forum Members
Forum Members
Posts: 97
Joined: Thu May 08, 2014 6:18 pm

Re: cms_selflink directing to incorrect page

Post by webguru »

That was it, Pink!
Thanks!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: cms_selflink directing to incorrect page

Post by velden »

Wild guess: href is interpreted as an integer because of the 5 in the beginning.
Could you try changing both the alias and href to eg five-cities?
Post Reply

Return to “CMSMS Core”