joomla-cms
joomla-cms copied to clipboard
[5.X] Global Checkin scheduler plugin fails on SQL Views
If you have a component which uses SQL Views for data preparation which is not update able the scheduler task fails.
Steps to reproduce the issue
- create a view based on #__content which is not update able (not adding the content id should work)
- setup the scheduler task global checkin
- checkout an item on #__content
- run a test on the global checkin task
Expected result
works
Actual result
fails with the result:
{
"success": false,
"message": "The target table jgb3i_jd_2_categories of the UPDATE is not updatable",
"messages": null,
"data": null
}
System information (as much as possible)
j5.0.2
Additional comments
jdiction uses view wit xml columns for translating table entries. Manual Global Checkin works as expected.
related issue #41149 ?
i'm unable to reproduce with this view
CREATE VIEW `#__blog` AS SELECT `title` ,`checked_out` ,`checked_out_time` FROM `#__content`
global checkin task runs fine
yes because this view is updateable, you need a view which does a bit more (I extract xml and override existing columns)
related issue #41149 ?
no it's a completely different topic
ah ok my bad
so with this view
CREATE VIEW j510_blog AS
select title, checked_out, checked_out_time from j510_content
union ALL
Select 'a', null, null
then the task will fail
i think we need to exclude from $tables = $db->getTableList();
the non updatable views
i'll check better after work
https://github.com/joomla-framework/database/blob/3.x-dev/src/Mysqli/MysqliDriver.php#L630
should only return tables (like the postgres version)
SHOW FULL TABLES WHERE Table_type='BASE TABLE'
should work, (it returns 2 columns but the called loadColumn() returns only the first column so should be fine)
yes indeed
thanks for the framework pr https://github.com/joomla-framework/database/pull/297 I think we can close this here