summaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-26 16:30:36 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-26 16:30:36 +0100
commit615fbacb7d9b67b1514e685721482e78ab64d559 (patch)
tree319e5893b953e52a8ba5ab2e8c3241de861221cf /import
parent83e3c025909dba57a950e3562a652858b11c2722 (diff)
downloadstock-615fbacb7d9b67b1514e685721482e78ab64d559.tar.gz
stock-615fbacb7d9b67b1514e685721482e78ab64d559.tar.bz2
stock-615fbacb7d9b67b1514e685721482e78ab64d559.zip
Fix expunge: use StockAssembly::lookup() instead of broken load() call
load() ignores its argument and reads mContentId/mAssemblyId from the object — passing an array did nothing. lookup(['content_id'=>...]) returns a fully loaded assembly ready for expunge(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'import')
-rw-r--r--import/ImportSimpleAssembly.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/import/ImportSimpleAssembly.php b/import/ImportSimpleAssembly.php
index 21c0f9a..a0c1694 100644
--- a/import/ImportSimpleAssembly.php
+++ b/import/ImportSimpleAssembly.php
@@ -32,9 +32,8 @@ function stockExpungeAssemblyByTitle( string $title ): bool {
return false;
}
- $assembly = new StockAssembly();
- $assembly->load( [ 'content_id' => $contentId ] );
- if( !$assembly->isValid() ) {
+ $assembly = StockAssembly::lookup( [ 'content_id' => $contentId ] );
+ if( !$assembly || !$assembly->isValid() ) {
return false;
}