Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the ModelDesignLayout->getLayout($route) #400

Closed
fanha99 opened this issue Jan 29, 2013 · 1 comment
Closed

Problem with the ModelDesignLayout->getLayout($route) #400

fanha99 opened this issue Jan 29, 2013 · 1 comment

Comments

@fanha99
Copy link

fanha99 commented Jan 29, 2013

hi,

the code inside this function is:

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_route WHERE '" . $this->db->escape($route) . "' LIKE CONCAT(route, '%') AND store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY route ASC LIMIT 1");

the problem is: why we need to

$this->db->escape($route) . "' LIKE CONCAT(route, '%')

why not just using

$this->db->escape($route) . "' LIKE route

when dev make some new route like: product/products and design a new layout for it.
than the system will never display correct in this route,
the system will always apply the modules which is set to the layout product/product

reason: after

ORDER BY route ASC

it always return
product/product
product/products

note that:

'product/products' LIKE CONCAT('product/product', '%')

will return 1 mean true.

the same, if we set 2 new layout for page/todo and page/todo_all

the layout for page/todo_all will never work correctly.

@opencart
Copy link
Collaborator

did a commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant