jDiction Forum

English => General Questions => Topic started by: infograf768 on June 24, 2012, 11:30:11 am

Title: Breaks in 2.5.6
Post by: infograf768 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
Title: Re: Breaks in 2.5.6
Post by: Harald Leithner 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
Title: Re: Breaks in 2.5.6
Post by: infograf768 on June 25, 2012, 11:56:19 am
Looks like you are indeed overriding JDatabase, which we did not think of...
Title: Re: Breaks in 2.5.6
Post by: Harald Leithner 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.