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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - joebarrus

Pages: [1] 2
1
General Questions / Re: jdlanguage link bug?
« on: May 13, 2014, 05:19:17 am »
Ok disregard.  It only happens when I set the homepage to Featured Articles.  However, some of the problem went away when I replaced the home menuitem with a new one so I think there was also some internal corruption.  However, it still occurs under some circumstances when I set the homepage to Featured Articles.

At this point I can no longer tell if this an environment issue or something else.  But I found a workaround so sorry post this.

Thanks

2
General Questions / Re: jdlanguage link bug?
« on: May 13, 2014, 04:00:02 am »
ok I'm really confused.  This only seems to be a problem when I make my homepage point to featured articles.  If point my homepage to a single article, then the internal URL of a subsequent hyperlink to another article looks like this

http://mysite.com/index.php/es/component/content/article/24-category/282-article

but if I make my homepage point to featured articles then the hyperlink looks like this

http://mysite.com/index.php/es/24-category/282-article

the "component/content/article" portion is missing.  I think this is what is messing up your code as when I point the homepage to a single article, your code works just fine as "$menuitem" is false but when pointing to featured articles $menuitem gets populated from your query.

I don't know enough of the internals of Joomla to know what is going on here but perhaps you might have a clue. 

Sorry for the multiple posts but this is just weird

thanks


3
General Questions / Re: jdlanguage link bug?
« on: May 13, 2014, 03:19:18 am »
Ok I noticed this only happens when using the internal url to an article.  doesn't matter if I turn SEF on or off since $query_sef still gets populated with a view parameter since $active->query['view'] is always "featured while $view (from $input) is "article".

4
General Questions / jdlanguage link bug?
« on: May 13, 2014, 02:06:35 am »
I have a problem with the building the link in the jdlanguage module.  This seems to happen when I navigate to a page using a hyperlink built to go to the article by id directly rather than through a menu item.  For instance, if I have a link built that looks like this http://mysite/index.php/es/282  where the article ID is used to render the article. 

I'm using jdiction 1.1.0 on Joomla 3.2.2

I debugged the issue and found in your jdlanguage helper.php code where it seems to be happening.  In the getLink() function on line 29 you define $active as

$active = $menu->getActive();

Then later you build the link under by adding the article id to the $query_sef[] array if $active->query['id'] exists but it doesn't exist because the active menu item wasn't used to navigate to this page.  Here is the code snippet in question on line 145

    if ($id) {
      $query[] = 'id='.$id;
      if (isset($active->query['id']) && $active->query['id'] != $id) {
        $query_sef[] = 'id='.$id;
      }
    }

since it never gets populated into the $query_sef[] array, it doesn't get added to the link when you build it on line 178
      if (!empty($query_sef)) {
        $link .= '?'.implode('&', $query_sef);
      }

$query_sef is not empty as it was populated with the view variable which does exist in the $active->query array so it leaves the id out of the URL string.

The view variable is "featured" and because this is different than "article" it populates the $query_sef with "article"

Suggestions?

thanks
Joe


5
Install & Configure jDiction / Re: Installation not working
« 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.

6
Install & Configure jDiction / Re: Installation not working
« 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.

7
Install & Configure jDiction / Re: Installation not working
« 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

8
Install & Configure jDiction / Re: Installation not working
« 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

9
Install & Configure jDiction / Re: Installation not working
« 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!

10
Install & Configure jDiction / Re: Installation not working
« 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


11
Install & Configure jDiction / Re: Installation not working
« 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

12
Install & Configure jDiction / Re: Installation not working
« 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

13
Install & Configure jDiction / Re: Installation not working
« 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

14
Install & Configure jDiction / Re: Installation not working
« 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

15
Install & Configure jDiction / Re: Installation not working
« 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

Pages: [1] 2