#6480: Helper functions don't return proper css and js urls if they contain
query
strings when using theme view
-----------------------------------+----------------------------------------
Reporter: ADmad | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: General
Version: 1.2 Final | Severity: Normal
Keywords: ADmad theme css js | Php_version: n/a
Cake_version: |
-----------------------------------+----------------------------------------
Lets say we have the file webroot/themed/default/css/default.css and the
controller is properly setup to use view "Theme" and theme
"default".[[BR]]
[[BR]]
Using
{{{
$html->css('default.css?1234')
}}}
creates css link
{{{
<link rel="stylesheet" type="text/css" href="/css/default.css?1234" />
}}}
instead of
{{{
<link rel="stylesheet" type="text/css"
href="/themed/default/css/default.css?1234" />
}}}
[[BR]]
The issue is the value for $path passed to Helper::webroot in the
Html::css function is "default.css?1234"
[[https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/libs/view/helpers/html.php#L350]].
This value is used to generate the file path and check it the particular
files exists in themed folder
[[https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/libs/view/helper.php#L197]].
But since the path contains "?1234" at the end the file_exists functions
returns false as expected. So to fix this the query string "?1234" needs
to be stripped off either when calling Helper::webroot or before doing the
file_exists check.[[BR]]
[[BR]]
Similar issue exists when using Javascript::link too.
--
Ticket URL: <https://trac.cakephp.org/ticket/6480>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---