ericingram / fwd-admin-url-rewrite

Enables fwd admin URL access from another template
1 stars 1 forks source link

Admin Pages Not Loading Admin Base Template #6

Open fr0x opened 11 years ago

fr0x commented 11 years ago

Haven't found the cause for this yet but it looks like pages within the Admin panel are not loading the base template properly.

Every page in the admin looks to be have its base layout defined by: /app/templates/admin/layouts/admin.html

With each individual section loading in its own info within:

{$content_for_layout}

The login and bootstrap page seem to load this fine

Orders, Products, Carts, Categories, etc.... do not seem to load the base layout file.

They just load whatever is in {$content_for_layout}

For example, the Orders page only shows the content in: /app/templates/admin/_default-index.html

ericingram commented 11 years ago

I have a feeling I fixed this already in the 'develop' branch, would you mind replacing your current test version with this?

https://github.com/getfwd/fwdcommerce/tree/develop

If it works for you I may just bump this to version 0.2 which would include the /admin shortcut out of the box, so others don't have to face these bugs over again. It also includes a few other minor fixes Thanks!

fr0x commented 11 years ago

Unfortunately it still seems to have this issue. Some of the other issues (PHP warning/exception error and /admin did work out of the box without any changes though).

fr0x commented 11 years ago

Think I found the issue. Was looking to see why it would be skipping the base template but the actual issue looks like its due to an error causing the thing to bomb out before rendering everything.

For the Products page in the Admin: App Error: Creating default object from empty value in /var/www/fwdcommerce/core/cache/481c9c03a3efec684fd7f2ea11cca7c309428b73.file.results.html.php on line 33 (code: 2), referer: http://myserver.com/admin/login

Line 33 of that file is: <?php $_smarty_tpl->tpl_vars['products']->value = get("/products", $_smarty_tpl->tpl_vars['query']->value); ?>

For the Orders page in the Admin: App Error: Creating default object from empty value in /var/www/fwdcommerce/core/cache/3a24174da8ce40874523fc55b39212fd5f25ae2a.file.results.html.php on line 35 (code: 2), referer: http://myserver.com/admin/login

Line 35 of that file is: <?php $_smarty_tpl->tpl_vars['orders']->value = get("/orders", $_smarty_tpl->tpl_vars['query']->value); ?>

ericingram commented 11 years ago

I believe this has something to do with 5.4 as we don't encounter this in 5.3. Can you determine what type of error is being raised by PHP? Is it a warning or otherwise something we can suppress for now?

fr0x commented 11 years ago

It is an E_WARNING

Changing /core/library/Request.php (line 80)

From: error_reporting(E_ERROR | E_WARNING | E_PARSE); To: error_reporting(E_ERROR | E_PARSE);

Fixes it.

I guess in 5.4 PHP got a little bit more strict in regards to objects/classes. If it isn't declared ($blah = new stdClass()) , it's now going to throw a warning. I tried messing around with E_STRICT (as I saw some people saying that was where the issue lies) but couldn't get it to work without taking out E_WARNING.