eZ Community » Forums » General » Problem with admin redirections
expandshrink

Problem with admin redirections

Problem with admin redirections

Friday 28 September 2012 5:57:16 am - 26 replies

Hi All,

I have a problem with my admin area redirecting to something like the following every time I clear cache or after doing things like show/hide from the context menu:

http://www.mysite.com/site_admin/content/treemenu/91/1348803553/1348800169/d7aadf5cd2b9595ddf97801795ae22b8

The page displays the JSON encoded content for the treemenu...

This issue has only just started after I just did a massively overdue upgrade from eZPublish 3.8.7 to 2012-8 (wasn't easy I can tell you)...

Anyone know what might be causing this or any idea of where I should start looking?

Cheers
Nathan.

Modified on Friday 28 September 2012 5:59:40 am by Nathan Kelly

Friday 28 September 2012 8:53:46 am

Hi.

I would check for some rewrite rules to makse sure they are correct.

Also(and related), using the web developers toolbar or the built in inspector in webkit browsers (Chrome), actually look at the console/NET pane and view the response for each item making up you page (specifically javascript files).

I had something similiar happen when doing an update (issue with subitems showing up in new admin interface).  The issue was that I was missing a newly needed rewrite rule.  The page loaded a script, but what was being returned was Module Not found - with a 200 status code. So, no script loaded and some items went a bit mad - including odd redirects..  It was not quickly apparent  because a quick look at the console showed that all files loaded properly (stats=200), but the bad response data(an html page) was not right..

Friday 28 September 2012 9:24:59 am

Hi David,

I thought rewrite rules would be involved too but I haven't been able to find which one is missing/should't exist, here's what I have:

DirectoryIndex index.php
RewriteEngine On
RewriteRule ^api/ index_rest.php [L]
RewriteRule ^index_rest\.php - [L]
RewriteRule ^([^/]+/)?content/treemenu.* index_treemenu.php [L]
RewriteRule ^var/([^/]+/)?storage/images(-versioned)?/.* - [L]
RewriteRule ^var/([^/]+/)?cache/(texttoimage|public)/.* - [L]
RewriteRule ^design/[^/]+/(stylesheets|images|javascript)/.* - [L]
RewriteRule ^share/icons/.* - [L]
RewriteRule ^extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
RewriteRule ^packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^var/storage/packages/.* - [L]
RewriteRule ^favicon\.ico - [L]
RewriteRule ^robots\.txt - [L]
RewriteRule ^w3c/p3p\.xml - [L]
RewriteRule .* index.php 

This was from the .htaccess_root file so I expected it to be right, I checked against some of my other sites and this looks a little different but they are on lower eZ versions so that's to be expected.

I checked the request in the FF NET console and I get a single GET request to the url (or similar) mentioned in my first post.

I'm stumped! Any other suggestions?

Cheers
Nathan.

Friday 28 September 2012 9:59:11 am

Yeah - because eZ Publish returns a 200 message even for module not found, a bad rewrite rule could be causing this for sure.

Imagine a free-standing script that has its own document.ready or similiar and is self contained.  Your browser will request the page, get a 200 for the page, realize that there is no script in the scource file and happily continue on its way.  So, the only easy way I know to find this type of silent problem is viewing the NET tab and looking at the responses in full.

Also, using the console in chrome specifically sometimes shows more errors as its less forgiving than firefox.

As for the rewrite rules, I've seen some good one come through (and am currently struggling with some issues myself with a long-standing rewrite rule issue. I've even seen some elegant solutions where the whole rewrite rule for ezpublish is in a few lines only.

The issue with using the ones given in the example htaccess_root is that it does not necessarily account for rules needed by extensions that you are carrying over like maybe ezoe or ezjscore or something.

Just for giggles, try changing the line:

RewriteRule ^([^/]+/)?content/treemenu.* index_treemenu.php [L]

to

RewriteRule content/treemenu.* index_treemenu.php [L]

 

yes, this is probably always reached from a sub-menu, so the rewrite you have should work (something)/content/treemenu, but in the case of a default siteaccess and a admin interface by hostname, I do not believe the first example works. (ex: http://admin.xxx.yyy.zzz/content/treemenu)

Wednesday 03 October 2012 7:51:32 am

Well I've tried a number of different rewrites but nothing has worked, I'm stumped...

Wednesday 17 October 2012 7:59:36 pm

Hi all,

I'm having the same issue, i think... In the admin interface, a json (in a blank page) pumps up sometimes when i hit the button "Clear", under Clean Cache (Right Menu). The same occurs, sometimes, when i interact with the Sub Items, on the Content Structure tab (end of "Copy subtree" action).

I'm using ezpublish5_community_project-2012.9-gpl-full. Chromium and Firefox browsers on Ubunto. The admin interface is in por-BR.

In the previous version that i use ezpublish_community_project-2012.5-with_ezc, this wont happen.

json:
{"error_code":0,"node_id":"67","children_count":1,"children":[{"node_id": ... ... }]}

URL:
http://site_name/index.php/site_a...192/43a864ded60564a9abaa0598b3d5d208

It's an annoying bug... What should i do?!

Thanks,

João

Wednesday 17 October 2012 10:51:16 pm

Hi João,

that's definitely the same issue I'm having, as of yet I have not found a solution, there must be something that has changed since 2012-8 that is causing this but I'm unsure where to start looking, new rewrite rules don't seem to resolve this issue.

I'm on the verge of starting a 10 year old website from scratch because this bug is making site management impossible and it doesn't seem to be present in a fresh install.

Cheers
Nathan.

Modified on Wednesday 17 October 2012 10:53:16 pm by Nathan Kelly

Thursday 18 October 2012 11:03:49 am

Hi Nathan,

The bug is present in a fresh install.

Anyone with the same issue?! ... ...

Help please!

Thanks,

João

Thursday 18 October 2012 11:13:35 am

Hmm... I don't have this issue in a fresh install under WAMP... not sure what's going on there...

Thursday 25 October 2012 6:53:52 pm

Same issue here with an fresh installation of ezpublish.

On my side this error appears on all terms (content/view/full/2, setup/cache, etc.).

Since its application/json Opera wants to download the information.
However Chrome simply displays it.

Its JSON like this:
{"error_code":0,"node_id:"2","children_count":0,"children":[]}

I tried following versions:

  • 2012.8
  • 2012.6

For all i can see it really seems like a rewrite-rule issue, but when i change .htaccess the issue is not solved.

The returned json also seems to be a return from following file:
http://projects.pwet.fr/svn/pwet/trunk/www/kernel/content/treemenu.php

I already spend about 3 days with this issue and i still can't see an end to it...

 

Hope someone finds the error with those informations.

 

EDIT:

I Fixed the Problem by more or less deactivating the whole cache.
Still on with debuging though...

Modified on Thursday 25 October 2012 7:16:02 pm by Steve Konrad

Thursday 25 October 2012 10:40:55 pm

I have since had this issue in a fresh install of 2012-8 so I'm not sure what was going on, still haven't found a viable fix for this...

Saturday 27 October 2012 2:40:34 am

Hi all,

to me it seems like a cache-problem, since the json can be compared to the last call of ezjscore-subtree-call (for example for the main-node "2"blunk.gif Emoticon in the left side-bar.

In the same time, i get to notice that something is really wrong with the fetches of the subtree-elements of the left side-bar.
For instance, it's showing the tree of the user-section to be the tree of media-section and all combinations including sub-elements of those trees.

Why i think its a cache-problem:

  1. The problem starts to start when the page has some cache-files created, the issue is not starting from scratch
  2. All json i get on blank page can also be found within the folder for the cache-files

Already checked the rights of the apache-user.
Everything seems to be fine.

FYI: I've never before installed eZ-Publish on the server i am currently using before.
I'm running a virtual-server with "Ubuntu 10.04.4 LTS" and Parallels Plesk on it.
PHP-Version is not 5.3.7 witch is told to be having problems with eZ-Publish.

Might there be some server-side settings i have to apply (accept the ones mentioned when using the installation-guide)?

Thanks, Steve

Sunday 28 October 2012 10:37:06 pm

This is now present in a fresh 2012-9 install too... this is a serious bug, I haven't found a bug report for it so I created one here:

https://jira.ez.no/browse/EZP-19904

Modified on Sunday 28 October 2012 10:37:39 pm by Nathan Kelly

Sunday 28 October 2012 10:47:02 pm

Found another related bug: https://jira.ez.no/browse/EZP-19841

Tuesday 30 October 2012 3:10:10 am

It seems to me that all of this problems are coming from the fact that JSON url-s in eZ are also considered as last visited pages. So what happens is that a JSON request i sent for some reason (get the items in tree menu, get the subitems of a folder...), an it gets recorded as the last visited page.

Then when the redirect is made, it redirects to the last page visited.

The solution to this problem that comes in mind:

  • setup a system that sets which pages can be used as last visited pages

This system should have this features:

  • set this on a module level so that for each module we can define whether it will be used as last visited page or not
  • set this on a layout level, so when you use something like "layout/set/ajax" or "layout/set/json" that you have the possibility not to count this layouts as the last visited page

Tuesday 30 October 2012 11:30:42 am

@Mavko good call.

I think this is currently doable, at least partially:

  • in index.php, session var LastAccessesURI is only modified when $module->uiContextName is not 'edit', 'administration', 'browse', 'authentication'
  • and a view can declare that either by using the ui_context key in its definition array, or using the $module->setUIContextName() call.

Otoh the variable LastAccessedModifyingURI seems to always be set - but then it is used very seldom: almost exclusively in eZRedirectManager::redirectURI - and even then only when the 3rd param is set to false - and there seems to be no code in current kernel which does use it that way...

Volunteers for a Jira issue + pull request?

Modified on Tuesday 30 October 2012 11:32:21 am by Gaetano Giunta

Tuesday 30 October 2012 2:23:17 pm

Hello

Do you have this issue with standalone eZ Publish legacy or through the Symfony stack ?

Tuesday 30 October 2012 3:04:13 pm

OK, I was able to reproduce the issue, but only if I don't have the following appropriate rewrite rule:

RewriteRule ^/([^/]+/)?content/treemenu.* /index_treemenu\.php [L]

Tuesday 30 October 2012 3:47:04 pm

Fixed in master: https://github.com/ezsystems/ezpu...99ff5a10b3c39ed35e676d9214da46993e75

Modified on Tuesday 30 October 2012 3:55:45 pm by Jérôme Vieilledent

Tuesday 30 October 2012 11:01:54 pm

Quote from Jérôme Vieilledent :

OK, I was able to reproduce the issue, but only if I don't have the following appropriate rewrite rule:

RewriteRule ^/([^/]+/)?content/treemenu.* /index_treemenu\.php [L]

Hi Jérôme,

I tried the RewriteRule you mentioned but I'm still getting the problem, I previously had this rule.

 RewriteRule ^([^/]+/)?content/treemenu.* index_treemenu.php [L]

Also I'm running the 2012-9 edition in legacy mode, I'm yet to try it under the symfony stack but i want to, just need some more time to read up on symfony (first impressions are very good though).

It's really good to see that this issue has gained some attention, thanks for all your efforts...

Cheers
Nathan.

Wednesday 31 October 2012 3:19:39 am

Quote from Jérôme Vieilledent :

Fixed in master: https://github.com/ezsystems/ezpu...99ff5a10b3c39ed35e676d9214da46993e75

It seems like a good solution for the modules, but what about layouts?

For example if I have an url like "layout/set/ajax/content/view/full/2", then I don't want this page to be used as the last access URI.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from