jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Author Topic: Breaks in 2.5.6  (Read 23689 times)

infograf768

  • Newbie
  • *
  • Posts: 2
    • View Profile
Breaks in 2.5.6
« on: June 24, 2012, 11:30:11 am »

Just tested your new component.
(Yes, I used the custom sqli, enabled the system plugin)

We do have many errors displaying and front-end is broken with core default templates beez 2 and 5
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Breaks in 2.5.6
« Reply #1 on: June 24, 2012, 12:28:11 pm »

Thx for the info, I was a bit scared on testing 2.5.6 because I read the Joomla Bugtracker and it was full with problems ;-)

So I found out that the problem is that the Joomla Core renamed the JDatabase::query function to JDatabase::execute so the translation could not intercept the query.

I will release a new version tomorrow, when I'm back at the office.

If you are interested to fix the problem your self you have to change the query() function in libraries/jdiction/database/jddatabase.php at line 388 to:
Code: [Select]
        public function execute() {

                // Check if we want and are ready to translate this query
                if (($this->jd_translate and $this->jd->getStatus())
                                // We only translate SELECT queries atm
                                and (strtoupper(substr(ltrim($this->sql), 0, 6)) == 'SELECT')) {

                        $origsql = $this->sql;
                        $origlimit = $this->limit;
                        $origoffset = $this->offset;
                        $sql = $this->addJoinKeys((string) $origsql);
                        $this->limit = $origlimit;
                        $this->offset = $origoffset;
                        $this->sql = $sql;
                        try {
                                parent::execute();
                                //restore original query
                                $this->sql = $origsql;
                        } catch (JDatabaseException $e) {
                                // there was a Problem with the query so we fallback to the unmodified
                                // version and try again
                                $this->sql = $origsql;
                                parent::execute();
                        }
                } else {
                        parent::execute();
                }

                if ($this->jd_translate || !$this->jd->getStatus()) {
                        $this->collectTranslationTables();
                }
                return $this->cursor;
        }
This will fail on version older then 2.5.5 I think
Logged
Joomla! 5.0 Release Manager
Vote at JED

infograf768

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Breaks in 2.5.6
« Reply #2 on: June 25, 2012, 11:56:19 am »

Looks like you are indeed overriding JDatabase, which we did not think of...
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Breaks in 2.5.6
« Reply #3 on: June 26, 2012, 12:03:20 am »

So I fixed the problem and released a new Version, atm not only for download from the website.
Autoupdate will follow.
Logged
Joomla! 5.0 Release Manager
Vote at JED