Adds DatabaseBootstrapTrait and OsposConfigFixtureTrait to replace
duplicated per-file setUp()/tearDown() bootstrap and OSPOS config mock
boilerplate across test classes, bringing them in line with the
ItemsControllerTest gold-standard shape.
Fixes the real root cause of tabular_helperTest's suite-order-dependent
failure: dropAllForeignKeyConstraints()/foreignKeyExists()/
dropColumnIfExists() temporarily blank the shared connection's DBPrefix
via overridePrefix() but never restored it if the query between the two
calls threw (e.g. migration_helperTest's mocked-failure tests) -
permanently corrupting prefixed table lookups for the rest of the
process. Wrapped each in try/finally. Also widens executeScript() to
accept an explicit connection so migration SQL can't silently run
against the wrong DB group.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
These landed on master by accident via a local branch that was
mistakenly created tracking OpensourcePOS/master directly, rather than
pushed as its own branch. Reverting to restore master to its prior
state; the reverted work will come back through a proper PR instead.
This reverts commit 00bf4cb8af.
This reverts commit 37cc1b15e7.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Adds DatabaseBootstrapTrait and OsposConfigFixtureTrait to replace
duplicated per-file setUp()/tearDown() bootstrap and OSPOS config mock
boilerplate across test classes, bringing them in line with the
ItemsControllerTest gold-standard shape.
Fixes the real root cause of tabular_helperTest's suite-order-dependent
failure: dropAllForeignKeyConstraints()/foreignKeyExists()/
dropColumnIfExists() temporarily blank the shared connection's DBPrefix
via overridePrefix() but never restored it if the query between the two
calls threw (e.g. migration_helperTest's mocked-failure tests) -
permanently corrupting prefixed table lookups for the rest of the
process. Wrapped each in try/finally. Also widens executeScript() to
accept an explicit connection so migration SQL can't silently run
against the wrong DB group.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add import_batch_contexts table plus ImportBatchContext model so
per-batch data (e.g. Items CSV attribute definitions) is stored
once and referenced by context_id, instead of duplicated into
every queued row's job payload.
- Extend queue_jobs, queue_jobs_failed, and new queue_paused_jobs
tables with batch_id/context_id columns and FKs (ON DELETE
RESTRICT) back to import_batch_contexts, so context rows cannot
be purged while any job still references them.
- Introduce ImportBatchService.pushRow() to centralize queuing a
batch row with batch/context stamping and priority; update
Customers and Items controllers to use it instead of calling
importBatch->create() and queue->push() separately.
- Add queue_paused_jobs table and Jobs::postPauseJobs()/pauseQueues()
to move pending jobs out of queue_jobs into a paused table per
queue (all core queues or a selected subset), leaving in-flight
jobs untouched (issue #3833 pause/resume design).
- Change Jobs::getEditJob()/postSaveJob() routes to accept separate
source/id path segments instead of a combined uid string.
- Add test coverage for ImportBatchContext, ImportBatchService, and
ImportBatch (including purge-retains-while-referenced guards).
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
Per the project's policy of treating security advisory IDs as
secret-like, remove the identifiers embedded in source/test comments
and CHANGELOG entries. Each keeps its human-readable description (and
PR number where present), so traceability is preserved. No logic changes.
fix(barcode): escape payload fields to prevent XSS; PSR-12 refactor
- Apply `esc()` to name, ID, item number, category, and company name in `Barcode_lib` payloads
- Remove redundant `urldecode()` in `Item_kitsController` to prevent triple decoding
- Rename variables and methods to camelCase across barcode, item_kits, and tests
- Add type hint for `$layoutType` parameter in `manageDisplayLayout`
- Add/update unit tests covering escaping and HTTP response assertions
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>