diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-26 16:30:36 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-26 16:30:36 +0100 |
| commit | 615fbacb7d9b67b1514e685721482e78ab64d559 (patch) | |
| tree | 319e5893b953e52a8ba5ab2e8c3241de861221cf /import | |
| parent | 83e3c025909dba57a950e3562a652858b11c2722 (diff) | |
| download | stock-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.php | 5 |
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; } |
