Repository navigation
Description
🐛 Bug Description
After upgrading from 3.3.8 to 3.4.3, adding a new item fails if any tax row is left empty (which is the default — the item form always shows Tax 1 and Tax 2).
Two validation errors occur, one after the other:
-
"Tax Name contains disallowed characters."
Cause: in app/Controllers/Items.php, validateItemFields() uses
'tax_names.*' => 'required|max_length[255]|unicode_alpha_numeric_punct'
The form always posts both tax rows, so an empty Tax 2 name failsrequired. Therequiredfailure is mapped to the Items.tax_name_invalid message, which is misleading. -
"Tax Percent must be a non-negative value."
Cause: 'tax_percents.*' => 'nonNegativeDecimal'. An empty % field is passed to OSPOSRules::nonNegativeDecimal(), parse_decimals('') returns false, so the rule fails.
Addingpermit_emptyto the rule did NOT fix it in my environment; it only worked after adding an empty check inside the rule itself.
postSave() already ignores tax rows whose percent is not numeric, so empty rows are safe to allow (as in 3.3.8).
validateBulkUpdateFields() has the same tax_percents rule.
Suggested fix
Items.php, validateItemFields():
'tax_names.' => 'permit_empty|max_length[255]|unicode_alpha_numeric_punct',
'tax_percents.' => 'permit_empty|nonNegativeDecimal',
Items.php, validateBulkUpdateFields():
'tax_percents.*' => 'permit_empty|nonNegativeDecimal',
OSPOSRules.php, nonNegativeDecimal() — add at the top:
if (trim($candidate) === '') {
return true;
}
📋 Steps to Reproduce
- Make sure Configuration → Tax has no default tax names/rates (or leave them empty).
- Go to Items → New Item.
- Fill in Item Name, Category, prices and quantities. Leave Tax 1 and Tax 2 empty.
- Click Submit → "Tax Name contains disallowed characters."
- Enter Tax 1 = "VAT", 0 %, leave Tax 2 empty, Submit → same error.
- After removing
requiredfrom tax_names.* → "Tax Percent must be a non-negative value."
✅ Expected Behavior
Items should save with empty tax rows, as in 3.3.8. Empty tax name/percent rows should be skipped, and only non-empty values validated (negative percentages still rejected).
📦 OpenSourcePOS Version
OpenSourcePOS 3.4.2
🔧 PHP Version
PHP 8.4
🌐 Browser(s)
No response
🖥️ Server Operating System
Windows server
🗄️ Database
mysql
🌍 Web Server
IIS
📊 System Information Report
General InfoOSPOS Installation Info: 3.4.3 - f81695
Language Code: en
OSPOS Timezone is Different from your Local Timezone.
Local Timezone: Asia/Colombo
OSPOS Timezone: Asia/Kolkata
Extensions & Modules:
» GD: ✓ Enabled
» BC Math: ✓ Enabled
» intl: ✓ Enabled
» OpenSSL: ✓ Enabled
» Multibyte String: ✓ Enabled
» cURL: ✓ Enabled
» JSON: ✓ Enabled
» XML: ✓ Enabled
User SetupBrowser: Chrome 155.0.0.0
Server Software: Microsoft-IIS/10.0
PHP Version: 8.5.12
DB Version: 8.0.35
Server Port: 443
OS: Windows NT 10.0
Permissions» [writable/logs] 0777 · ✓ Writable · ✗ Vulnerable or Incorrect Permissions
» [public/uploads] 0777 · ✓ Writable · ✗ Vulnerable or Incorrect Permissions
» [public/uploads/item_pics] 0777 · ✓ Writable · ✗ Vulnerable or Incorrect Permissions
» [importCustomers.csv] 0666 · ✓ Readable · ✗ Vulnerable or Incorrect Permissions
Security Vulnerability Warning
Incorrect permissions leaves this software at risk.
» [writable/logs] is writable, but the permissions are incorrectly set. Please set it to 750 and refresh.
» [public/uploads] is writable, but the permissions are incorrectly set. Please set it to 750 and refresh.
» [public/uploads/item_pics] is writable, but the permissions are incorrectly set. Please set it to 750 and refresh.
» [importCustomers.csv] is readable, but the permissions are incorrectly set. Please set it to 640 or 660 and refresh.
📜 Relevant Log Output
📸 Screenshots
No response
✓ Confirmation
- I certify that this is an unmodified copy of OpenSourcePOS
- I have searched existing issues to ensure this bug has not already been reported
- I have provided all the information requested above
Activity
jekkos commentedon Oct 22, 2026
@MufassalAmeer — fix is up in #4774. Could you verify it resolves the issue on your end (3.4.3, IIS, empty Tax 1 + Tax 2 rows)?
objecttothis commentedon Oct 23, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (fix not yet merged).
app/Controllers/Items.phpvalidateItemFields()still has:— no
permit_empty, so an empty Tax 2 row still failsrequiredwith the misleadingItems.tax_name_invalidmessage, exactly as described.validateBulkUpdateFields()similarly still has'tax_percents.*' => 'nonNegativeDecimal'with nopermit_empty.There's an open, unmerged PR addressing this: #4774 "fix(items): allow empty tax rows on item save", and a maintainer has asked the reporter to verify it. Since #4774 hasn't landed on
masteryet, the bug is still reproducible there.