No Code Attached Yet
avatar HLeithner
HLeithner
7 Feb 2024

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

  1. create a view based on #__content which is not update able (not adding the content id should work)
  2. setup the scheduler task global checkin
  3. checkout an item on #__content
  4. 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.

avatar HLeithner HLeithner - open - 7 Feb 2024
avatar joomla-cms-bot joomla-cms-bot - change - 7 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Feb 2024
avatar HLeithner HLeithner - change - 7 Feb 2024
The description was changed
avatar HLeithner HLeithner - edited - 7 Feb 2024
avatar brianteeman
brianteeman - comment - 23 Feb 2024

related issue #41149 ?

avatar alikon
alikon - comment - 25 Feb 2024

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

avatar HLeithner
HLeithner - comment - 25 Feb 2024

yes because this view is updateable, you need a view which does a bit more (I extract xml and override existing columns)

avatar HLeithner
HLeithner - comment - 25 Feb 2024

related issue #41149 ?

no it's a completely different topic

avatar alikon
alikon - comment - 26 Feb 2024

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 

image

then the task will fail

image

i think we need to exclude from $tables = $db->getTableList(); the non updatable views

i'll check better after work

avatar HLeithner
HLeithner - comment - 26 Feb 2024

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)

avatar alikon
alikon - comment - 27 Feb 2024

yes indeed

avatar HLeithner HLeithner - change - 27 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-27 21:31:36
Closed_By HLeithner
avatar HLeithner HLeithner - close - 27 Feb 2024
avatar HLeithner
HLeithner - comment - 27 Feb 2024

thanks for the framework pr joomla-framework/database#297 I think we can close this here

Add a Comment

Login with GitHub to post a comment