Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property Order->reference length (10) must be between 0 and 9 #1078

Closed
techjp opened this issue Oct 19, 2019 · 3 comments
Closed

Property Order->reference length (10) must be between 0 and 9 #1078

techjp opened this issue Oct 19, 2019 · 3 comments

Comments

@techjp
Copy link

techjp commented Oct 19, 2019

In the TB database the Order>reference field is a VARCHAR(100), as is the order_payment>order_reference field.

However when trying to create random order reference values it appears that the length of this field is limited to 9 characters.

This was discussed here on Stack Overflow a few years back and it seems that in PS the actual database limit was 9 characters. The database column limit has been increased with TB but the code that limits the maximum length wasn't adjusted accordingly.

@techjp
Copy link
Author

techjp commented Oct 19, 2019

Looking a bit and testing a bit, both Order.php (line 51) and OrderPayment.php (line 72) need to be tweaked to a larger number in order to allow larger order reference numbers. Both are set to 9 in the standard installation.

@getdatakick
Copy link
Contributor

In the TB database the Order>reference field is a VARCHAR(100), as is the order_payment>order_reference field.

It's not, see here

Column definition is:

`reference` varchar(9) COLLATE utf8mb4_unicode_ci DEFAULT NULL

If you have varchar(100) on your installation, it must be caused by some third party module, or by manual modification

@techjp
Copy link
Author

techjp commented Oct 19, 2019

Ah, I see what caused that to happen. The original module I used to generate random order reference numbers redefined the two columns to be much larger.

After I uninstalled that module the column definitions remained VARCHAR(100) but the table definition overrides were removed and that resulted in the exceptions I was seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants