Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Bugfix: class.page.php > translations of names/titles are not returned

If you use translations you will remark, that localized titles are not returned, this bugfix will sove the problem:

affected file: include > class.page.php

Find function in line 59 to 61 :

    function getLocalName($lang=false) {
        return $this->getLocal('name', $lang);
    }

after this add the following:

    function getLocalNameUsers($lang=false) {
        return $this->_getLocal('name', $lang);
    }

And now replace in all affected user templates in "include > client" the code like in this example for "include > client > login.inc.php":

Find code from line 9 to 11:

if ($content) {
    list($title, $body) = $ost->replaceTemplateVariables(
        array($content->getName(), $content->getBody()));

and replace it with:

if ($content) {
    list($title, $body) = $ost->replaceTemplateVariables(
        array($content->getLocalNameUsers() ?: $content->getName(), $content->getLocalBody() ?: $content->getBody()));

Adding a new function was necessary, because we remarked that in other places like pages the function getLocalName works correct. We don't like to dive to deep in the code to find a solution this will work with all situations where getLocalName is used, so we decided to create this workaround. You have only to edit the six affected pages in "include > client" to get them work correctly.

Best regards,
Jürgen
Tagged:

Comments

  • please make pull requests on github for bug fixes.  The devs will never see them here.
  • edited June 12
    @ntozier: We will prepare a bug fix package and make pull requests on github. But we need a little time for that... Posting here is done in a second, when we are working on the code. ;o)
Sign In or Register to comment.