? ? Pending

User tests: Successful: Unsuccessful:

avatar Kurantje
Kurantje
24 Dec 2022

Query requires back-quoted table name to acommodate for table names with special characters.

Pull Request for Issue #39487

Summary of Changes

On line 734 it states: ->from($this->_tbl);
This should be: ->from($this->_db->quoteName($this->_tbl));

Testing Instructions

Create a component using a table with a special character, e.g. da-events
Go to ...?option=&view=event&layout=edit&id=1 to get the first element from the table

Actual result BEFORE applying this Pull Request

Invalid mySQL query exception

Expected result AFTER applying this Pull Request

In edit.php get the data from the da-events table for id=1

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 24 Dec 2022
Category Libraries
avatar Kurantje Kurantje - open - 24 Dec 2022
avatar Kurantje Kurantje - change - 24 Dec 2022
Status New Pending
avatar ReLater ReLater - test_item - 24 Dec 2022 - Tested unsuccessfully
avatar ReLater
ReLater - comment - 24 Dec 2022

I have tested this item ? unsuccessfully on 158adff

See my comment below


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39489.

avatar ReLater
ReLater - comment - 24 Dec 2022

There are some more code places that must be fixed via quoteName().

At least methods checkOut(), checkIn(). but I didn't test any further. Just opened and closed an item in my test component where I renamed the main table from ghsthing to ghsvs-thing and added protected $_tbl = '#__ghsvs-thing'; in my table class (extends Table). I got errors like example:

1064 You have an error in your SQL syntax; 
check the manual that corresponds to your MariaDB server version 
for the right syntax to use near '-thing SET `checked_out` = 340 ,
 `checked_out_time` = '2022-12-24 19:22:39' ...' at line 1

I didn't save or update and so on then.

The first fix of this pr ( load() ) works, but ... see above.

avatar ReLater
ReLater - comment - 24 Dec 2022

@Kurantje
I have provided a pr in your branch that you can merge into your branch and into this pr at the same time if you like to.
See Kurantje#1

avatar Kurantje Kurantje - change - 26 Dec 2022
Labels Added: ?
avatar Kurantje
Kurantje - comment - 26 Dec 2022

@ReLater, Thanks for highlighting. Submitted Table.php again, now with all sql table references with QuoteName

avatar Kurantje Kurantje - change - 26 Dec 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-12-26 14:02:21
Closed_By Kurantje
avatar Kurantje Kurantje - close - 26 Dec 2022
avatar ReLater
ReLater - comment - 26 Dec 2022

@Kurantje
Why did you close your PR?

avatar Kurantje Kurantje - change - 26 Dec 2022
Status Closed New
Closed_Date 2022-12-26 14:02:21
Closed_By Kurantje
avatar Kurantje Kurantje - change - 26 Dec 2022
Status New Pending
avatar Kurantje
Kurantje - comment - 26 Dec 2022

Oops! Didn't mean to. Will reopen. Thanks!

avatar Kurantje Kurantje - reopen - 26 Dec 2022
avatar ReLater ReLater - test_item - 27 Dec 2022 - Tested successfully
avatar ReLater
ReLater - comment - 27 Dec 2022

I have tested this item successfully on 4e50a2d

avatar joomdonation joomdonation - test_item - 29 Dec 2022 - Tested successfully
avatar joomdonation
joomdonation - comment - 29 Dec 2022

I have tested this item successfully on 4e50a2d

Code review + tried to view, delete, publish, unpublish.... records and all still works.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39489.

avatar joomdonation joomdonation - change - 29 Dec 2022
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 29 Dec 2022

RTC. Thanks !


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39489.

avatar roland-d roland-d - change - 29 Dec 2022
Labels Added: ?
avatar roland-d roland-d - close - 29 Dec 2022
avatar roland-d roland-d - merge - 29 Dec 2022
avatar roland-d roland-d - change - 29 Dec 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-12-29 10:47:56
Closed_By roland-d
avatar roland-d
roland-d - comment - 29 Dec 2022

Thank you

Add a Comment

Login with GitHub to post a comment