ISSUE SUMMARY:
AdAgency tries to redirect to url without language suffix. System plugin "Language Filter" redirects from url without suffix to url with suffix based on browser preferences.
STEPS TO REPLICATE:
Turn on system language filter plugin, create two languages (ex. 'ru' and 'en') and try to display ad agency menu. An attempt to enter any ad agency menu item, requiring approved advertiser account, leads to infinite redirections:
RESULT
index.php?option=com_adagency&Itemid=148 (ad agency control panel item id)
=> 303 (see other) .../ru/index.php?option=com_adagency&Itemid=148
(this is redirection by system language plugin)
and AdAgency redirects again to url without language suffix:
303 (see other) ?option=com_adagency&Itemid=148
...
EXPECTED RESULT
Show page, like it works with language filter plugin off.
BROWSER
Firefox 39
Hi, Igor.
I assign developer to this thread.
Hi Igor,
This is not a bug is something that is not developed yet in adagency.
I will inform our project Manager about this and maybe we will add on the road map for next development.
Thank you,
Alin
Hi, Alin!
You should write in all capital on product page description that AdAgency extension does not support built-in Joomla multilanguage mode and thus cannot be used on multilanguage sites. That's really a pity.
Can we get money back then?
Igor,
can you please edit your first post and add there website login? admin and FTP? I want to have a look over.
Please advise.
Alin
Thank you for reply. We've prepared a test package for this case.
Part of the message is hidden for the guests. Please log in or register to see it.
We've found out that bug seems to appear when not approved advertiser (like test superuser account) tries to open Control Panel, My Orders etc. menu. When you press back, you'll see:
Repeated 10 times"Your advertiser account is currently pending, therefore you can't access all the advertiser pages, when you're approved, we will send you an Email to let you know."
Hi Igor,
Please give me a link and access to your installation, for some reason installing that package locally have some issues.
Having direct access to site where the issue is will help me better to debug. Please advise.
Thanks,
Alin
Notices for undefined variables are fixed using @ before variable names.
Notice: Undefined property: stdClass::$id in modules\mod_ijoomla_adagency_zone\helper.php on line 1655
Notice: Undefined property: stdClass::$type in modules\mod_ijoomla_adagency_zone\helper.php on line 1777
Redirection problem:
Search by: AD_FAILEDAPPROVE, find $link="..." without JRoute::_ wrapper.
\components\com_adagency\controllers\adagencyReports.php:42, :80
adAgencyCpanel.php:37
...[about 10-12 files]...
Example:
$link="index.php?option=com_adagency".$Itemid;
Programmer forgot to use JRoute on link. Also JRoute second parameter should be false to not escape link, used later for redirections.
=> $link=JRoute::_("index.php?option=com_adagency".$Itemid, false);
Solution is regular expression search and replace through components\com_adagency\controllers\:
Find: ^(\s*)\$link(\s*)=(\s*)("index[^;]+);
Replace with: $1$link$2=$3JRoute::_($4, false);
Next problem does not concerns language at all. Infinite redirections are caused by adagencyCPanel.php.
It redirects unapproved advertisers to:
$item_id = $this->model2->getItemid('adagencyadvertiser');
:37 => $link=JRoute::_("index.php?option=com_adagency".$Itemid, false);
:50 => } elseif($adv_id[1]!='Y'){
$this->setRedirect($link, JText::_('AD_FAILEDAPPROVE'), 'notice');
}
Here the issue goes:
docs.joomla.org/Potential_backward_compa...Joomla_Platform_12.2
>> JDatabase::getEscaped() has been removed. Use JDatabase::escape() instead
Now look at com_adagency\models\adagencyconfig.php
function getItemid($controller){var_dump($controller);
$db = JFactory::getDBO();
$controller = $db->getEscaped($controller); // <<< ERROR, null returned
$sql = "SELECT id FROM `#__menu`
WHERE `menutype` = 'adagency'
AND `link` LIKE '%index.php?option=com_adagency&view={$controller}%' ";
//echo "** " . $sql . " **";die();
$db->setQuery($sql);
$res = (int)$db->loadResult();var_dump([$controller, $sql, $res]);
return ($res == 0) ? JRequest::getInt('Itemid', '0', 'get') : $res;
}
Hi,
I added for next version all these changes and soon a new AdAgency version will be released.