opening window - access right problem?

Status
Not open for further replies.

susannanam

Member
hi all,

i have a list with a button that opens a window via js. so far so good. if i open the list and click on the button and then execute some more js (from the opened window) in the administrator backend, it works fine.

if i open the same thing as user (superuser, the same as loged in before) in the frontend, it does not work but gives no error at all.

i assume it has something to do with with access rights but i have not yet figured out what it is... i did set everything to public and go in on both sides as superuser. any hint why it does not work the same on both sides?

thanks
susanne
 
here is how i open the window:

Code:
/*show enrolments to select */
window.open('http://www.blabla.na/index.php?option=com_fabrik&task=list.view&listid=152&tmpl=component','Select courses to invoice','width=800,height=600');

i just found out if i open the list 152 in the admin, all works perfect. if i open the previous form in admin and then click the button, it also does not work... so it is not about frontend-backend but something else... but what????
 
Unfortunately, J! uses different routing on the front end and back end, so the URL's are slightly different. You URL is using the backend style "&task=list.view", which on the front end needs to be "&view=list".

-- hugh
 
thanks Hugh for your answer. yes i have tried that version before but no luck either, so i changed the open command, thinking the problem is situated there... it is probably something small as it does open the window but if then clicking on the php-button, it just "collapses" without any error message in the frontend while doing the same in the backend works perfectly fine.i have used a update_col plugin and also tried a php-plugin but the same issue on both. i then reduced the update_col plugin to change a value in a column and took out the php code completely to find the issue. but it kept on having the same issue! so i thought it must be some access right but i really have no more clue...

susanne
 
there is three scenarios:
1) if i open the base form and click on the button in the frontend (as superuser), it opens the new window but there, the php plugin collapses without any further error (it immediately shows the home-page of the new window, the base form on the second window is still fine)
2) if i open the base form and click on the button in the backend (as superuser), it opens the new window but there, the php plugin collapses without any further error (it immediately shows the home-page of the new window, the base form on the second window is still fine)
3) if i open the select form directly (the one to be opened by the button) in the backend (as superuser), the php plugin works perfectly

maybe that makes it a bit clearer and might give someone an idea what i am having wrong :)

susanne
 
Yeah, I just don't think it's going to work. List plugins work by either submitting a form action, which will reload the whole page, or via AJAX, which will get confused if you are doing it from a window opened that way. And they will behave differently on the backend, again because of differences in the way J!'s routing works.

That's kind of why we have our own window handler, which we use for popping up lists and forms in their own windows, which understands the context it is being used in, and handles things like list plugins appropriately.

You could try adding &ajax=1 to the URL.

== hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top