Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Nested.php to support aliasing the 'checked_out' column. #42697

Merged
merged 3 commits into from Feb 5, 2024

Conversation

skillet-actual
Copy link
Contributor

Removed hard-coded references to the 'checked_out' database column and replaced them with variables containing the column alias, obtained through a $this->getColumnAlias() call. Now, the 'checked_out' column references mirror the 'published' column references in their respect for column aliasing.

Pull Request for Issue #42688 .

Summary of Changes

Removed hard-coded references to the 'checked_out' database column and replaced them with variables containing the column alias, obtained through a $this->getColumnAlias() call. Now, the 'checked_out' column references mirror the 'published' column references in their respect for column aliasing. Also made sure the '=' operators lined up nicely in the variable declaration/initialization lines while I was at it.

Testing Instructions

Change the published state of one or more items whose data are stored in a nested table, i.e. the Tags component to ensure the change did not break existing functionality. To verify new support for aliasing, instantiate the class and call the publish() method from a client that uses an alias for the 'checked_out' column.

Actual result BEFORE applying this Pull Request

Attempting to change the published state of an item in a custom admin list view failed with error message, "Unknown column 'checked_out' in 'where clause'". The database column was properly aliased in the table's __construct() method with the following code:

$this->setColumnAlias('checked_out', 'checked_out_user_id');

Expected result AFTER applying this Pull Request

Attempting to change the published state of an item in a custom admin list view succeeds.

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

Removed hard-coded references to the 'checked_out' database column and replaced them with variables containing the column alias, obtained through a $this->getColumnAlias() call. Now, the 'checked_out' column references mirror the 'published' column references in their respect for column aliasing.
@alikon
Copy link
Contributor

alikon commented Jan 29, 2024

I have tested this item ✅ successfully on 91c827d


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

1 similar comment
@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on 91c827d


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

@Quy
Copy link
Contributor

Quy commented Jan 30, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 30, 2024
@MacJoom MacJoom self-assigned this Feb 5, 2024
@MacJoom MacJoom added this to the Joomla 4.4.3 milestone Feb 5, 2024
@MacJoom MacJoom enabled auto-merge (squash) February 5, 2024 19:47
@MacJoom
Copy link
Contributor

MacJoom commented Feb 5, 2024

Thank you!

@skillet-actual
Copy link
Contributor Author

Thank you!

You're quite welcome--it's so nice to be able to give back, even if in just this tiny way. :)

@MacJoom MacJoom merged commit fa6fd0a into joomla:4.4-dev Feb 5, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants