user profile link not working after update from Joomla 3.8 to 3.9
up vote
0
down vote
favorite
I have updated Joomla 3.8 to 3.9 and then the user Written by author link is not working any more; it doesn't show any link to click on it, also the issue is on the plugins/content/contact/contact.php — when I replace it with the one of the 3.8 version, it shows the Written by author link ..
I have tested it with Protostar template but same issue ..
How can I solve this please?
And how can I override this file to the template?
This the code of the 3.8 version:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactId($row->created_by);
$row->contactid = $contact->contactid;
if ($row->contactid)
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
else
{
$row->contact_link = '';
}
return true;
}
and this from Joomla 3.9:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if an alias is used
if ($this->params->get('link_to_alias') == 0 & $row->created_by_alias != '')
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactData($row->created_by);
$row->contactid = $contact->contactid;
$row->webpage = $contact->webpage;
$row->email = $contact->email_to;
if ($row->contactid && $this->params->get('url') == 'url')
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
elseif ($row->webpage && $this->params->get('url') == 'webpage')
{
$row->contact_link = $row->webpage;
}
elseif ($row->email && $this->params->get('url') == 'email')
{
$row->contact_link = 'mailto:' . $row->email;
}
else
{
$row->contact_link = '';
}
return true;
}
thanks
amine
joomla joomla3.0
add a comment |
up vote
0
down vote
favorite
I have updated Joomla 3.8 to 3.9 and then the user Written by author link is not working any more; it doesn't show any link to click on it, also the issue is on the plugins/content/contact/contact.php — when I replace it with the one of the 3.8 version, it shows the Written by author link ..
I have tested it with Protostar template but same issue ..
How can I solve this please?
And how can I override this file to the template?
This the code of the 3.8 version:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactId($row->created_by);
$row->contactid = $contact->contactid;
if ($row->contactid)
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
else
{
$row->contact_link = '';
}
return true;
}
and this from Joomla 3.9:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if an alias is used
if ($this->params->get('link_to_alias') == 0 & $row->created_by_alias != '')
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactData($row->created_by);
$row->contactid = $contact->contactid;
$row->webpage = $contact->webpage;
$row->email = $contact->email_to;
if ($row->contactid && $this->params->get('url') == 'url')
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
elseif ($row->webpage && $this->params->get('url') == 'webpage')
{
$row->contact_link = $row->webpage;
}
elseif ($row->email && $this->params->get('url') == 'email')
{
$row->contact_link = 'mailto:' . $row->email;
}
else
{
$row->contact_link = '';
}
return true;
}
thanks
amine
joomla joomla3.0
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have updated Joomla 3.8 to 3.9 and then the user Written by author link is not working any more; it doesn't show any link to click on it, also the issue is on the plugins/content/contact/contact.php — when I replace it with the one of the 3.8 version, it shows the Written by author link ..
I have tested it with Protostar template but same issue ..
How can I solve this please?
And how can I override this file to the template?
This the code of the 3.8 version:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactId($row->created_by);
$row->contactid = $contact->contactid;
if ($row->contactid)
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
else
{
$row->contact_link = '';
}
return true;
}
and this from Joomla 3.9:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if an alias is used
if ($this->params->get('link_to_alias') == 0 & $row->created_by_alias != '')
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactData($row->created_by);
$row->contactid = $contact->contactid;
$row->webpage = $contact->webpage;
$row->email = $contact->email_to;
if ($row->contactid && $this->params->get('url') == 'url')
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
elseif ($row->webpage && $this->params->get('url') == 'webpage')
{
$row->contact_link = $row->webpage;
}
elseif ($row->email && $this->params->get('url') == 'email')
{
$row->contact_link = 'mailto:' . $row->email;
}
else
{
$row->contact_link = '';
}
return true;
}
thanks
amine
joomla joomla3.0
I have updated Joomla 3.8 to 3.9 and then the user Written by author link is not working any more; it doesn't show any link to click on it, also the issue is on the plugins/content/contact/contact.php — when I replace it with the one of the 3.8 version, it shows the Written by author link ..
I have tested it with Protostar template but same issue ..
How can I solve this please?
And how can I override this file to the template?
This the code of the 3.8 version:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactId($row->created_by);
$row->contactid = $contact->contactid;
if ($row->contactid)
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
else
{
$row->contact_link = '';
}
return true;
}
and this from Joomla 3.9:
public function onContentPrepare($context, &$row, $params, $page = 0)
{
$allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
if (!in_array($context, $allowed_contexts))
{
return true;
}
// Return if we don't have valid params or don't link the author
if (!($params instanceof Registry) || !$params->get('link_author'))
{
return true;
}
// Return if an alias is used
if ($this->params->get('link_to_alias') == 0 & $row->created_by_alias != '')
{
return true;
}
// Return if we don't have a valid article id
if (!isset($row->id) || !(int) $row->id)
{
return true;
}
$contact = $this->getContactData($row->created_by);
$row->contactid = $contact->contactid;
$row->webpage = $contact->webpage;
$row->email = $contact->email_to;
if ($row->contactid && $this->params->get('url') == 'url')
{
JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php');
$row->contact_link = JRoute::_(ContactHelperRoute::getContactRoute($contact->contactid . ':' . $contact->alias, $contact->catid));
}
elseif ($row->webpage && $this->params->get('url') == 'webpage')
{
$row->contact_link = $row->webpage;
}
elseif ($row->email && $this->params->get('url') == 'email')
{
$row->contact_link = 'mailto:' . $row->email;
}
else
{
$row->contact_link = '';
}
return true;
}
thanks
amine
joomla joomla3.0
joomla joomla3.0
edited Nov 15 at 7:01
Armali
6,92093697
6,92093697
asked Nov 14 at 23:28
Amine Lahmar
12
12
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310304%2fuser-profile-link-not-working-after-update-from-joomla-3-8-to-3-9%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown