user profile link not working after update from Joomla 3.8 to 3.9












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










share|improve this question





























    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










    share|improve this question



























      0












      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 7:01









      Armali

      7,4901137101




      7,4901137101










      asked Nov 14 '18 at 23:28









      Amine LahmarAmine Lahmar

      33




      33
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          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

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values