Unable to change state in frontend when SEF enabled

10 months 4 weeks ago - 10 months 3 weeks ago #70887 by yopyop001
Hi,

In front end with SEF url activated, i'm unable to change the state of items (in category or module view)
the template use :
$statebutton = flexicontent::statebutton(...)

I have a js alert box :

Error status: 404 , Error text: Not Found


In my browser console :
i have the 404 for the file
https://site.tld/path_1/path_2/index.php?option=com_flexicontent&format=raw&task=setitemstate&id=876&state=-5&lang=

If i disable SEF in Joomla configuration, it's working as excepted.

Regards

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago #70888 by yopyop001
in components/com_flexicontent/assets/js/stateselector.js

if i change line 42
script_url: 'index.php?option=com_flexicontent&format=raw',
by
script_url: '/index.php?option=com_flexicontent&format=raw',

It works in frontend, but it's broken in backend (error 500 Invalid controller)

May be we have to add isAdmin (or not) in flexicontenthtml::statebutton(...) parameters to adapt script url...

Regards

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago #70892 by ggppdk
Hello

i think remember a similar fix in the past
then we merge the stateselector JS code and this issue was re-introduced ?

will make the URLs absolute
please open a new issue in github


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago #70909 by ggppdk
Hello

i tested will localhost and with flexicontent.org

i cannot confirm the issue

it is working properly
- just the cache is not cleared ...

thus if you refresh the page you will see the old state


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago #70911 by ggppdk
Hello

but i do confirm that the URL is relative thus it is wrong

maybe it breaks depending on current menu item

in any case we are need to fix the URL
will do


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago - 10 months 4 weeks ago #70914 by ggppdk
Hello
$js .= "
	var fc_root_uri = '" . JUri::root(true) . "';
	var fc_base_uri = '" . JUri::base(true) . "';
...

	var currentURL = window.location;
	var live_site = currentURL.protocol + '//' + currentURL.host + fc_base_uri;

and then URL will be
	script_url: live_site + '/index.php?option=com_flexicontent&format=raw',

in
fc_votes.js
fc_favs.js

we use fc_root_uri , but in case of stateselector.js we need fc_base_uri because it is used in both frontend and backend


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago #70927 by yopyop001
Thanks Georgios.

I'm not sure to put your code in the right place.
Will wait for fix.

Regards.

Please Log in or Create an account to join the conversation.

10 months 4 weeks ago - 10 months 4 weeks ago #70928 by ggppdk


-- FLEXIcontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

10 months 1 week ago #71147 by yopyop001
It works great,

Thanks Georgios !

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.