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 44293 times)

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #15 on: August 28, 2013, 10:51:23 am »

I have no information about other translation extensions, I only know falang/joomfish which do the same as jdiction, maybe with a better query parser.

But your fix (with whitespace) should fix this problem. By the way thats a complex query that could easily fail by the query parser, do you have the modified query?
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #16 on: August 28, 2013, 11:45:56 pm »

Thanks to you I have now become an expert Php programmer  LOL.  Really, I hadn't installed any sophisticated tools and have simply been peppering my code with output statements.  But in order to continue to debug I had to install Eclipse with XDebug and learn how to use them  :)  So thank you.  :)

Anyway, below is both the entire original query and the modified one.  Your modified query changed the FROM clause to FRO losing the M.

sql =
                Select
                    form.id As form_id,
                    form.act_as_registration,
                    form.default_category,
                    form.registration_name_field,
                    form.registration_username_field,
                    form.registration_email_field,
                    form.registration_email_repeat_field,
                    form.`last_update`,
                    article.`article_id`,
                    form.`title_field`,
                    form.`create_articles`,
                    form.`name`,
                    form.`use_view_name_as_title`,
                    form.`protect_upload_directory`,
                    form.`reference_id`,
                    records.`record_id`,
                    form.`type`,
                    form.`published_only`,
                    form.`own_only`,
                    form.`own_only_fe`,
                    records.`last_update` As record_last_update,
                    article.`last_update` As article_last_update
                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 )
                Where
                    form.`published` = 1
                And
                    form.create_articles = 1
                And
                    form.`type` = records.`type`
                And
                    form.reference_id = records.reference_id
                And
                   (
                     (
                        article.form_id = form.id
                      And
                        article.record_id = records.record_id
                      And
                        article.article_id = content.id
                      And
                        ( content.state = 1 Or content.state = 0 )
                      And
                      (
                        form.`last_update` > article.`last_update`   
                       Or
                        records.`last_update` > article.`last_update`
                      )
                     )
                     Or
                     (
                        form.id Is Not Null And records.id Is Not Null And content.id Is Null And article.id Is Null
                     )
                   )
                Limit 50

Modified query

sql =
                Select
                    form.id As form_id,
                    form.act_as_registration,
                    form.default_category,
                    form.registration_name_field,
                    form.registration_username_field,
                    form.registration_email_field,
                    form.registration_email_repeat_field,
                    form.`last_update`,
                    article.`article_id`,
                    form.`title_field`,
                    form.`create_articles`,
                    form.`name`,
                    form.`use_view_name_as_title`,
                    form.`protect_upload_directory`,
                    form.`reference_id`,
                    records.`record_id`,
                    form.`type`,
                    form.`published_only`,
                    form.`own_only`,
                    form.`own_only_fe`,
                    records.`last_update` As record_last_update,
                    article.`last_update` As article_last_update
                Fro, records.id AS JD_MAGIC_KEY_1, form.id AS JD_MAGIC_KEY_2, article.id AS JD_MAGIC_KEY_3, content.id AS JD_MAGIC_KEY_4 m
                    #__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 )
                Where
                    form.`published` = 1
                And
                    form.create_articles = 1
                And
                    form.`type` = records.`type`
                And
                    form.reference_id = records.reference_id
                And
                   (
                     (
                        article.form_id = form.id
                      And
                        article.record_id = records.record_id
                      And
                        article.article_id = content.id
                      And
                        ( content.state = 1 Or content.state = 0 )
                      And
                      (
                        form.`last_update` > article.`last_update`   
                       Or
                        records.`last_update` > article.`last_update`
                      )
                     )
                     Or
                     (
                        form.id Is Not Null And records.id Is Not Null And content.id Is Null And article.id Is Null
                     )
                   )
                Limit 50

I'll keep digging to see if I an find more.  In the meantime I do have another issue showing itself but haven't had time to tackle that one yet.  It seems that my links keep tacking on additional language parameters to the URL.  Like http://localhost/es/es/index.php.   Any clue why this might be happening?  It might be my next debug project.  :)

Thanks
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #17 on: August 28, 2013, 11:48:49 pm »

correction, after looking at the query again, it looks like your code inserted the additional select items into the middle of the word FROM

Logged

Harald Leithner

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

I use a query parser to get the from position and this parser isn't always right...

If the query would use the Jdatabasequery class it there would be no problem... but so its really hard to prevent this error.

Mostly because I missed 2 deadlines and have not much time atm for jdiction... especially because 3rd party components are still not supported...

the other problem does normally happen if the access level of the content language is wrong... but maybe not in this case.
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #19 on: August 29, 2013, 02:37:29 am »

yeah I found where it was breaking.  I guess I'm going to have to hack his code to make it work and suggest he use the solution you suggest.  I have deadlines too and need to get this done. :)  But if I can fix it as  I go, with a little help from you, I can get it to work.  I'll keep you informed of any other issues I see.

I may get back to you on the second issue if it persists, but it may be a result of this issue.  I haven't seen it come back during my debug sessions today.  I changed the position number in the debugger and everything would load fine after that.  But you know that may simply mean that I just unblocked one door just so I can see another blocked door  :)

Thanks!
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #20 on: August 29, 2013, 04:37:39 am »

Well, Harald I rewrote that query using jDatabaseQuery as you suggested and it works!  :)  It was a bit of a pain to write and I was worried if I left some of the more complex clauses as longer strings it wouldn't work, but instead I was happily surprised!  :)  so, the second issue did not show up so I think that was a result of the funky behavior caused by the first.  So far so good.

I'll suggest to the extension author he do this as well to ensure compatibility with other extensions like yours.

I appreciate the good work and I'll let you know if I run into anything else.
Thanks
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #21 on: August 29, 2013, 10:42:19 am »

Thx good to know.

jDiction only needs 2 things from the query
1. all direct tables (FROM and JOINS) in including the alias, but not from subqueries.
2. the Position of FROM statement to inject the Primary keys of all tables

There is much optimization potential. I'm not good at regex but I think this information could be "easy" parsed by the regex.
Logged
Joomla! 5.0 Release Manager
Vote at JED

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #22 on: August 30, 2013, 02:17:08 am »

Regex is one of those things that is a little daunting at first but once you understand the syntax becomes fairly easy and very powerful. Used with Php's regex functions it is really easy to pull exact pattern matching content out of large text strings such as articles.  I used the following resources to help

http://www.regular-expressions.info/reference.html
This is just a nice syntax reference

http://txt2re.com/
This is a great tool to help you develop regex expressions and understand exactly how it works!

Joe
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #23 on: August 31, 2013, 10:28:01 am »

So I continue to have the double language tags like en/en or es/es on my links after logging in.  Any suggestions?  I haven't found much on it yet on the Internet and I'm having trouble debugging it.
Logged

joebarrus

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Installation not working
« Reply #24 on: September 01, 2013, 10:39:11 am »

nevermind. I ended up writing a plugin to strip the extra codes out.  I couldn't figure out what was causing it though I suspect it might be caused by a component reloading the page and causing the language filter to fire twice combined with SEF mode.  The language filter definitely was the code that was doing this in the build rules.
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Installation not working
« Reply #25 on: September 08, 2013, 10:45:14 pm »

That shouldn't happend... i need Some more information
Logged
Joomla! 5.0 Release Manager
Vote at JED

Pages: 1 [2]