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
![Smiley :)](https://forum.jdiction.org/Smileys/default/smiley.gif)
So thank you.
![Smiley :)](https://forum.jdiction.org/Smileys/default/smiley.gif)
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.
![Smiley :)](https://forum.jdiction.org/Smileys/default/smiley.gif)
Thanks