I'm going out on a limb here and sharing my test failure info to see if someone can help sort this out. In testing JTableCorecontent::store()
, tests are failing when they go into the storeUcmBase
method.
JTableCorecontentTest::testStore
PDOException: SQLSTATE[HY000]: General error: 1 near "SET": syntax error
/libraries/joomla/database/driver/pdo.php:684
/libraries/cms/table/corecontent.php:285
/libraries/cms/table/corecontent.php:250
/tests/unit/suites/libraries/table/JTableCorecontentTest.php:179
I can build a test database and manually build in the data and run each query without issue. So, to me, the queries aren't an issue. Any thoughts here?
Below are each of the queries being run in during this test method in the SQLite environment:
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '3'
UPDATE `jos_ucm_content` SET `core_type_alias`='com_content.article',`core_title`='New Title',`core_alias`='article-categories-module',`core_body`='<p>This module displays a list of categories from one parent category. <a href="http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help16:Extensions_Module_Manager_Articles_Categories" title="Categories Module">Help</a></p>
<div class="sample-module">{loadmodule articles_categories,Articles Categories}</div>
<p> </p>',`core_state`='1',`core_checked_out_time`='',`core_checked_out_user_id`='0',`core_access`='1',`core_params`='',`core_featured`='0',`core_metadata`='',`core_created_user_id`='0',`core_created_by_alias`='',`core_created_time`='2011-01-01 00:00:01',`core_modified_user_id`='0',`core_modified_time`='2013-05-04 19:19:41',`core_language`='*',`core_publish_up`='2011-01-01 00:00:01',`core_publish_down`='0000-00-00 00:00:00',`core_content_item_id`='3',`core_images`='',`core_urls`='',`core_hits`='0',`core_version`='1',`core_ordering`='6',`core_metakey`='modules, content',`core_metadesc`='',`core_catid`='64',`core_xreference`='',`core_type_id`='1' WHERE `core_content_id`='3'
pragma table_info(jos_ASSETS)
SELECT id
FROM jos_assets
WHERE parent_id = 0
SELECT `id`
FROM `jos_assets`
WHERE `name` = '#__ucm_content.3'
SELECT COUNT(id)
FROM `jos_assets`
WHERE `id` = 1
SELECT id, parent_id, level, lft, rgt
FROM jos_assets
WHERE id = 1 LIMIT 0, 1
UPDATE jos_assets
SET lft = lft + 2
WHERE lft > 424
UPDATE jos_assets
SET rgt = rgt + 2
WHERE rgt >= 424
INSERT INTO `jos_assets`
(`name`,`title`,`rules`,`parent_id`,`level`,`lft`,`rgt`) VALUES
('#__ucm_content.3','#__ucm_content.3','[]','1','1','424','425')
UPDATE `jos_ucm_content`
SET asset_id = 176
WHERE `core_content_id` = 3
SELECT lang_id
FROM jos_languages
WHERE `lang_code` = '*'
# Failing query is this UPDATE query
UPDATE `jos_ucm_base`
SET `ucm_item_id` = '3'
, `ucm_type_id` = '1'
, `ucm_language_id` = ''
WHERE `ucm_id` = '3'
# End of failing query
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '3'
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '8'
INSERT INTO `jos_ucm_content`
(`core_type_alias`,`core_title`,`core_alias`,`core_body`,`core_state`,`core_checked_out_time`,`core_checked_out_user_id`,`core_access`,`core_params`,`core_featured`,`core_metadata`,`core_created_user_id`,`core_created_by_alias`,`core_created_time`,`core_modified_user_id`,`core_modified_time`,`core_language`,`core_publish_up`,`core_publish_down`,`core_content_item_id`,`core_images`,`core_urls`,`core_hits`,`core_version`,`core_ordering`,`core_metakey`,`core_metadesc`,`core_catid`,`core_xreference`,`core_type_id`) VALUES
('com_content.article','Beginners (Copy)','beginners-copy','<p>If this is your first Joomla! site or your first web site, you have come to the right place. Joomla will help you get your website up and running quickly and easily.</p>
<p>Start off using your site by logging in using the administrator account you created when you installed Joomla.</p>
','1','','0','1','','1','','0','','2013-05-04 19:19:41','0','0000-00-00 00:00:00','*','2011-01-01 00:00:01','0000-00-00 00:00:00','8','','','1','1','4','','','19','','1')SELECT id
FROM jos_assets
WHERE parent_id = 0
SELECT `id`
FROM `jos_assets`
WHERE `name` = '#__ucm_content.69'
SELECT COUNT(id)
FROM `jos_assets`
WHERE `id` = 1
SELECT id, parent_id, level, lft, rgt
FROM jos_assets
WHERE id = 1 LIMIT 0, 1
UPDATE jos_assets
SET lft = lft + 2
WHERE lft > 426
UPDATE jos_assets
SET rgt = rgt + 2
WHERE rgt >= 426
INSERT INTO `jos_assets`
(`name`,`title`,`rules`,`parent_id`,`level`,`lft`,`rgt`) VALUES
('#__ucm_content.69','#__ucm_content.69','[]','1','1','426','427')
UPDATE `jos_ucm_content`
SET asset_id = 177
WHERE `core_content_id` = 69
SELECT lang_id
FROM jos_languages
WHERE `lang_code` = '*'.
UPDATE `jos_ucm_content`
SET `core_state` = 0
WHERE `core_content_id`IN (18,31) AND (`core_checked_out_user_id` = 0 OR `core_checked_out_user_id` = 0)
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '18'
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '31'
UPDATE `jos_ucm_content`
SET `core_state` = 1
WHERE `core_content_id`IN (31) AND (`core_checked_out_user_id` = 0 OR `core_checked_out_user_id` = 0)
SELECT *
FROM jos_ucm_content
WHERE `core_content_id` = '32'```
Figured it out, I was looking at the wrong line of code. Back to work I go ;-)