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

Pages: [1] 2

Author Topic: Installation not working  (Read 44136 times)

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Installation not working
« on: August 25, 2013, 02:22:19 am »

Hi,
I've installed the latest version of JDiction - 0.9.9.10
I'm using Joomla 3.1.5
I'm using Spanish language pack es-ES - 3.1.5.1 from Communidad Joomla

Symptoms:
1.  I see the translate flags next to content and can bring up the input pages.  But when I save, Joomla says content successfully saved but no content is saved.  I've looked in the database table _jd_store (the only one I find that I think is yours) and it has no entries.  I have set the database driver to jdiction_mysqli.

2.  When in Spanish Mode I click to a page that uses a Single Article as the content and my site goes into a never ending redirect loop between 302 and 303.  Also links to other components just don't load.   I'll try to install a different language pack using a different dialect of Spanish and see if that makes a difference.  It could be the pack I'm using.  But not sure if this should affect Symptom #1

Thanks
Joe




Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #1 on: August 25, 2013, 09:54:41 am »

Part one is strange... do you use a custom editor?

2. Is the permission level of the content language.
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #2 on: August 25, 2013, 09:17:36 pm »

I'm using JCE.  But I tried with no editor or Tiny MCE and it's the same, not storing.  One thing I noticed in the JDiction Check is that it says Multiple Plugins have the same loading position (0) but everything else looks good.

The permission level of the Content Language (language manager/content) are all Public.

I'll do some more digging and see if I can figure out what happens when I save. I'll open the code and do some debugging and report back.  But I need to pick a language content manager very soon and I had hope this one would work as I had heard good things.  I haven't tried the others yet though.

thanks
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #3 on: August 26, 2013, 02:16:14 am »

Ok I've narrowed it down.  The values status are coming in as Unchanged.  In your save function the values for $langdata and $status are as follows:

$langdata = array (
  'es-ES' =>
  array (
    'title' => 'new title',
    'alias' => 'new-alias',
    'metakey' => '',
    'metadesc' => '',
    'articletext' => '',
  ),
  'idJdStore' =>
  array (
  ),
  'tags' => NULL,
)

$status = array (
  'es-ES' =>
  array (
    'title' => 'unchanged',
    'alias' => 'unchanged',
    'metakey' => 'unchanged',
    'metadesc' => 'unchanged',
    'articletext' => 'unchanged',
  ),
)


I can see that you use Javascript to change it.  The boxes are changing to Orange as I add input so the JS is working there but looks like the jQuery call isn't happening. Do you have a jQuery conflict?  If so I haven't figured out how to remove that yet.   I'll work on that unless you find something else or can tell me how to resolve this

thanks
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #4 on: August 26, 2013, 09:26:16 am »

Ok the jQuery call definitely isn't working.  I changed the value of one of the status input fields manually in the browser to 'changed' and the data saves fine.  Not sure what the issue is but does sound like a jQuery conflict.  But I haven't figured out how to fix that.  I've tried the various methods I've Googled but none seem to work.  Suggestions?
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #5 on: August 26, 2013, 09:32:14 am »

If you can plz send me a supersdmin account per pm
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #6 on: August 26, 2013, 06:45:44 pm »

I sent you access via PM but it doesn't show up in the sent folders.  Let me know if you didn't receive it

Thanks
Joe
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #7 on: August 27, 2013, 01:25:50 am »

I figured it out.  You have a conflict between JQuery and Mootools.  I have jQuery loaded twice on my page, once before moot0ols and once after,  I'm not really sure what is loading the first one but all I did was wrap your code that is using Mootools with the following:

// For Mootols scripts
(function($){

// set a local $ variable only available in this block as an alias
// to Mootools document.id
... here is your Mootools specific code ...

})(document.id);

This allows your Mootools to work without conflict as you localized scope of the $ variable to only mean an id selector.  Only problem is I don't know where throughout your code you use Mootools where I need to fix that.  It would be nice if you can release a patch that wraps all your Mootools code this way.  Alternatively, I can try to find out what extension I am using that is loading jQuery first but that might take some time but also leaves your code vulnerable to future extensions that might reload jQuery first.

I took away super admin access as you don't need it anymore.  But please let me know if you can release a patch or let me know where in your code you use Mootools so I can patch it myself.

Thanks
Joe
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #8 on: August 27, 2013, 08:01:20 am »

Ok I solved the backend issue but now I have a frontend issue.  Translating articles seem to work fine but my menus are not translating.  The data is being stored and when I sniff the db load I can see the data being retrieved but the menu never renders translated. 

I've restored access to the super user account I gave you in PM.  Please feel free to use it to see if you can figure out why.  If I can get articles and menus to work I think I'm golden

thanks
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #9 on: August 27, 2013, 10:18:34 am »

Ok thx for the debugging.

2 things.

1st jdiction should not use mootools anymore in Joomla 3.x environment, if you its a bug. I found some mootools code in Joomla 3 part of the component, I will replace it and release a new version here in this thread.

2nd the problem that a menu is not translated has mostly todo with another plugin or template engine. First you have todo for this is to make sure the jdiction plugin is loaded on position 1 and all other plugins on position 2 or later.

if this doesn't help some plugin is badly coded.

Logged
Joomla! 5.0 Release Manager
Vote at JED

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #10 on: August 27, 2013, 03:20:41 pm »

This version use less mootools in Joomla 3+
I didn't replaced the formvalidation and tooltip handling because I didn't found a jquery replacement... maybe I missed it.
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #11 on: August 27, 2013, 11:53:33 pm »

Harald,
Got things working.  I think your latest patch made a difference.  I also removed some extensions I no longer needed including some plugins that were at position 0.  I moved all plugins to position 2 except one - Crosstec.de Contentbuilder.  I had to place it at position 1 to work.  But only the Language Filter is at position 0 and jDiction and Contentbuilder at position 1 with everything else position 2 or higher.

so far everything seems to work including the menus.  Not sure what fixed that.  :)

Thanks for the help.  Nice component, very intuitive to use.

Joe
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #12 on: August 28, 2013, 07:42:36 am »

Ok things were working until I tried to load my Contentbuilder froms.  Contentbuilder is a forms type extension from Crosstec.de.   If I tried to load the form it broke.  After many more hours of debugging I figured it out.  Your database driver searches for table name of #__content to decide if it should translate.  When Contentbuilder loads a form, it sends this query through the driver

sql = '
            Select
                forms.config,
                forms.verification_required_view,
                forms.verification_required_new,
                forms.verification_required_edit,
                forms.verification_days_view,
                forms.verification_days_new,
                forms.verification_days_edit,
                forms.verification_url_view,
                forms.verification_url_new,
                forms.verification_url_edit,
                contentbuilder_users.userid,
                forms.limit_add,
                forms.limit_edit,
                (Select count(id) From #__facileforms_records Where form = 3 And user_id = 407)  As amount_records,
                contentbuilder_users.verified_view,
                contentbuilder_users.verified_new,
                contentbuilder_users.verified_edit,
                contentbuilder_users.verification_date_view,
                contentbuilder_users.verification_date_new,
                contentbuilder_users.verification_date_edit,
                contentbuilder_users.limit_add As user_limit_add,
                contentbuilder_users.limit_edit As user_limit_edit,
                contentbuilder_users.published
                ,\'0\' As edited
            From
                #__contentbuilder_forms As forms
                Left Join
                    #__contentbuilder_users As contentbuilder_users
                On ( contentbuilder_users.form_id = forms.id And contentbuilder_users.userid = 407 )
               
            Where
                forms.id = 32
            And
                forms.published = 1

As you can see, it selects from a table called #_contentbuilder which equates to TRUE in a strpos() search in your driver in the translateQuery() function within this piece of code
      //search for a supported table
      $tables = $this->jd->getTable();
      foreach($tables as $table) {
        if (strpos($this->sql, $table->name) !== false) {
          $translate = true;
        }
Well the condition evaluates to TRUE since #__content is the beginning #__contentbuilder.  You need to search for for an exact match.

I patched it by concatenating a space after $table->name but I think the best answer is to replace strpos with a regex match.

Joe
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #13 on: August 28, 2013, 08:26:53 am »

The problem is not so easy to solve. A regex maybe work but the table name could have some forms like space or return or enclosed.

And speed is a factor at this position. Starting a regex has a hugh overhead. But if you have ine I will consider it.

Thx
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #14 on: August 28, 2013, 09:52:17 am »

regex is not so bad on speed.  But I've run into another problem.

Same contentbuilder is joining #__content in a query like this part of a query.
.......
                From
                    #__contentbuilder_records As records
                    Left Join #__contentbuilder_forms As form On ( form.`type` = records.`type` And form.reference_id = records.reference_id )
                    Left Join #__contentbuilder_articles As article On ( form.`type` = records.`type` And form.reference_id = records.reference_id And article.form_id = form.id And article.record_id = records.record_id )
                    Left Join #__content As content On ( form.`type` = records.`type` And form.reference_id = records.reference_id And article.article_id = content.id And article.form_id = form.id And article.record_id = records.record_id )

So my forms load still keeps failing.   Getting late here, will work on it more tomorrow.  Do other translation extensions have the same issue?

thanks
Logged
Pages: [1] 2