Closed (fixed)
Project:
Commerce AutoSKU
Version:
7.x-1.1
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2012 at 21:57 UTC
Updated:
11 Apr 2017 at 16:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pulliMan commentedI'm suffering the same issue, that for my usecase I'd need more than 255 characters.
So I was happy to read, that you as well were wishing a solution like in Entity auto label.
Did you manage to do your workaround already?
I'd be very happy to benefit from your patch, because unfortunately I'm still at the very beginning in learning Drupal and not yet(!) able to fix such things by myself.
Comment #2
dwatts3624 commentedSo I tried implementing hook_schema_alter() and hook_form_alter(). I got far but apparently, I don't understand how hook_schema_alter() works since it doesn't seem to actually make any changes to the database.
In any case, I feel like we're probably not the only people who need a longer field here so I'm submitting at patch. This will only work if you uninstall the old version, apply it, then re-enable. Since one of the updates was actually already increasing the size of the field (though not enough) I wasn't sure how to handle the hooks so I just re-wrote that one. Hope I didn't do anything terribly wrong there. I've been trying to participate more with patches but am still a bit of a newbie.
Comment #3
pulliMan commentedHi,
thankyou for your answer,
meanwhile I tried something similar, even more primitive...
It is certainly not the way one is supposed to do it, but it works for now..
function commerce_autosku_update_7101(&$sandbox) {
@@ -42,5 +42,5 @@ function commerce_autosku_update_7101(&$sandbox) {
'description' => 'Token replacement pattern.',
'type' => 'varchar',
- 'length' => 255,
+ 'length' => 500,
'not null' => TRUE,
);
Comment #4
rbayliss commentedWe're limited to 255 characters in the SKU because of the database restrictions, but you're right - there's no reason the pattern can't be longer. I added an update hook to make this column big text, and removed the limit from this field. I'm not in favor of making the pattern field a textarea though. Thanks!
Comment #6
joelstein commentedPlease see the follow-up issue at #2868735: Character limit (still) set at 255.