diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-31 10:06:48 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-31 10:06:48 +0100 |
| commit | cef2bbde0cbaa042a545f432865de11e0bc51d03 (patch) | |
| tree | 53315ea10db725ec3b99ca31c7c016b0b60f89f6 /edit_movement.php | |
| parent | 693acd68d2dcdbfd700a3aab6c49251552cc9be0 (diff) | |
| download | stock-cef2bbde0cbaa042a545f432865de11e0bc51d03.tar.gz stock-cef2bbde0cbaa042a545f432865de11e0bc51d03.tar.bz2 stock-cef2bbde0cbaa042a545f432865de11e0bc51d03.zip | |
Remove stock_component table — use liberty_content directly
stock_component was a pure alias (component_id ↔ content_id with no
other data). All queries now target liberty_content WHERE
content_type_guid = STOCKCOMPONENT_CONTENT_TYPE_GUID directly.
- StockComponent: drop mComponentId, constructor takes content_id only
- All component_id URL params changed to content_id
- Import files, edit_movement, sitemap updated to match
- BOM xref templates updated (xref column migrated from component_id
to content_id in live DB — 130 rows)
- StockAssembly loadXrefList/enrichXrefDisplay join liberty_content
directly; loadComponents drops stock_component LEFT JOIN
- StockBase: previous/next keys renamed to _content_id
stock_component table left in schema_inc.php pending DB reset.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'edit_movement.php')
| -rw-r--r-- | edit_movement.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/edit_movement.php b/edit_movement.php index dac02c6..7a3146f 100644 --- a/edit_movement.php +++ b/edit_movement.php @@ -46,10 +46,9 @@ if( !empty( $_REQUEST['save'] ) ) { $errors[] = 'Quantity cannot be negative.'; } else { $contentId = $gBitDb->getOne( - "SELECT sc.`content_id` - FROM `".BIT_DB_PREFIX."stock_component` sc - INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = sc.`content_id` - WHERE lc.`title` = ?", + "SELECT lc.`content_id` + FROM `".BIT_DB_PREFIX."liberty_content` lc + WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?", [ $componentTitle ] ); if( !$contentId ) { @@ -96,10 +95,9 @@ if( !empty( $_REQUEST['save'] ) ) { } $contentId = $gBitDb->getOne( - "SELECT sc.`content_id` - FROM `".BIT_DB_PREFIX."stock_component` sc - INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = sc.`content_id` - WHERE lc.`title` = ?", + "SELECT lc.`content_id` + FROM `".BIT_DB_PREFIX."liberty_content` lc + WHERE lc.`content_type_guid` = '".STOCKCOMPONENT_CONTENT_TYPE_GUID."' AND lc.`title` = ?", [ $componentTitle ] ); if( !$contentId ) { |
