jDiction Forum

English => General Questions => Topic started by: Xaman on September 12, 2014, 07:22:44 pm

Title: New errors
Post by: Xaman on September 12, 2014, 07:22:44 pm
Hi,

After updating jDiction to the latest version (1.3.1) I am now getting an error message when I check a translated page.

These are the errors:

Quote
Notice: Undefined index: c in /libraries/jdiction/jdiction.php on line 521

Notice: Undefined index: c in /libraries/jdiction/jdiction.php on line 535

Notice: Undefined index: in /libraries/jdiction/jdiction.php on line 535

The page seems to show the translated information correctly.
Title: Re: New errors
Post by: Harald Leithner on September 12, 2014, 07:32:32 pm
You can reduce the error reporting level in joomla config.

I will also fix this notice.
Title: Re: New errors
Post by: Xaman on September 12, 2014, 07:35:28 pm
Thanks :)
Title: Re: New errors
Post by: Xaman on January 19, 2015, 08:18:25 pm
Hi,

Once again I updated my jReviews and S2 Framework and the problem returns and can't seem to fix it. Can you take a look again?
Title: Re: New errors
Post by: Harald Leithner on January 19, 2015, 08:30:20 pm
which error?
Title: Re: New errors
Post by: Xaman on January 19, 2015, 09:51:55 pm
which error?
Sent you the link by message.
Title: Re: New errors
Post by: Xaman on January 21, 2015, 03:54:35 am
Were you able to see the error?
Title: Re: New errors
Post by: Harald Leithner on January 21, 2015, 08:18:16 am
Yes but didn't remember what to change in symfony. Did I wrote a mail to you?
Title: Re: New errors
Post by: Harald Leithner on January 21, 2015, 09:53:54 am
I found this message
Quote
        // Add query KEY HINTS
        if(isset($queryData['useKey'])) {
            $table_alias = key($queryData['useKey']);
            $key_hint = $queryData['useKey'][$table_alias];
            if($table_alias == $this->name) {
                //$useTable .= ' USE KEY ('.$key_hint.')';
            }
            elseif (isset($queryData['joins'][$table_alias])) {
                $split_ON = explode('ON',$queryData['joins'][$table_alias]);
                $split_ON[0] .= ' USE KEY ('.$key_hint.') ';
                //$queryData['joins'][$table_alias] = implode('ON',$split_ON);
            }
        }

I disabled 2 lines but didn't remember the file. Its something in the s2 database framework.
Title: Re: New errors
Post by: Xaman on January 21, 2015, 02:37:00 pm
Found it here: /components/com_s2framework/s2framework/libs/model/model.php

I removed that part and it's still giving the error.
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 04:53:46 pm
I need the query that makes this problem...

maybe you activate the debugger and send me the logfile file it should be in /logs/jdiction.php or something like this.
Title: Re: New errors
Post by: Xaman on January 22, 2015, 05:45:07 pm
I need the query that makes this problem...

maybe you activate the debugger and send me the logfile file it should be in /logs/jdiction.php or something like this.
Ok, how do I send you this file? To which email?
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 06:24:02 pm
joomla@itronic.at
Title: Re: New errors
Post by: Xaman on January 22, 2015, 06:26:10 pm
joomla@itronic.at
Sent.
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 06:39:28 pm
In this file are 10000 translated queries... so I will not find the correct one ;-)

would you please change the following lines in /libraries/jdiction/database/jddatabase.php

line 428:
Code: [Select]
JLog::add('Query translated: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
} else {
JLog::add('Query not translated: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
//JLog::add('Backtrace: ' . @json_encode(debug_backtrace()), JLog::DEBUG, 'jdiction');
}

to:
Code: [Select]
if ($_REQUEST['debug'] == '2') JLog::add('Query translated: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
} else {
if ($_REQUEST['debug'] == '2') JLog::add('Query translated: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
//JLog::add('Backtrace: ' . @json_encode(debug_backtrace()), JLog::DEBUG, 'jdiction');
}

then delete the log file and open the page which cause the error with the parameter ?debug=2 attached at the end of the url.

and send the new file again.
Title: Re: New errors
Post by: Xaman on January 22, 2015, 06:45:10 pm
Done and sent.
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 06:55:42 pm
good the needed query is not in it ;-)

please add after line 386 ("translate = fale;") the following line:

Code: [Select]
if ($_REQUEST['debug'] == '2') JLog::add('Query: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
Title: Re: New errors
Post by: Xaman on January 22, 2015, 07:07:51 pm
Ok, done and sent the new logs file.
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 07:20:34 pm
please send me a superuser account.

and do you have the latest jdiction version installed?

because it seams that it translates "UPDATE" and "SHOW" queries but that shouldn't be done.
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 07:30:10 pm
And I did't a misstake.

could you change the code to:
line 429 or so to:
Code: [Select]
} else {
if ($_REQUEST['debug'] == '2') JLog::add('Query not translated: ' . str_replace("\n", '\n', $this->sql), JLog::DEBUG, 'jdiction');
//JLog::add('Backtrace: ' . @json_encode(debug_backtrace()), JLog::DEBUG, 'jdiction');
}

because atm all queries are translated in the log and thats not true ;-)

Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 07:34:09 pm
Oh I think I found it

could you search for the string
Code: [Select]
# Removed directory from order by because it makes the query SLOW
Code: [Select]
# Instead we run a much faster query below to re-order the output array
and remove both lines, it seams that they are both in the same query and the parse could not handle comments.
Title: Re: New errors
Post by: Xaman on January 22, 2015, 07:44:19 pm
Oh I think I found it

could you search for the string
Code: [Select]
# Removed directory from order by because it makes the query SLOW
Code: [Select]
# Instead we run a much faster query below to re-order the output array
and remove both lines, it seams that they are both in the same query and the parse could not handle comments.
Remove from where exactly?
Title: Re: New errors
Post by: Harald Leithner on January 22, 2015, 08:44:49 pm
Search for the Text in the joomla Installation. It must bin in component.
Title: Re: New errors
Post by: Xaman on January 22, 2015, 08:48:46 pm
I don't know how to do that, I can only search for files names.
Title: Re: New errors
Post by: Harald Leithner on January 23, 2015, 12:13:55 pm
Do you have a local copy of your site?

if so you can do it locally.

Anyway the should be in /components/com_jReviews/ and then maybe in models directory.

alternative install the attached version.
delete the logfile.
open the url with ?jDictionDebug=2
and send me the logfile.

then I should be able to find the file faster.

btw. the new version fixes a utf8 url translation problem.
Title: Re: New errors
Post by: Xaman on January 23, 2015, 03:32:54 pm
Ok, sent you the new logs file.
Title: Re: New errors
Post by: Harald Leithner on January 23, 2015, 03:58:36 pm
You have a good chance to find this in
/components/com_jreviews/jreviews/cms_compat/joomla/models/category.php near line 613 or 679
Title: Re: New errors
Post by: Xaman on January 23, 2015, 04:10:43 pm
Finally, it worked! Thanks, seems they changed the location of these files, but now I know where is it. :D

Thanks again for all your help.
Title: Re: New errors
Post by: Harald Leithner on January 23, 2015, 04:22:25 pm
I will try to fix this problem in jdiction too but maybe not today ;-)