TC
Twill CMSsiașamaideparte

Upgrading custom form fields from 2.x to 3.x?

I noticed after upgrading Twill to 3.x from 2.x that my custom form fields no longer work. Is there a guide somewhere for how to upgrade them? I did notice that there doesn't seem to be a section in 3.x any longer about custom fields, in the docs.
I
ifox32d ago
Hi @siașamaideparte the content you're looking for is probably this: https://twillcms.com/guides/creating_custom_components_form_fields_and_blocks.html#content-part-3---custom-form-field-example There shouldn't be any upgrade needed between twill 2 and 3.
Twill
S
siașamaideparte32d ago
@ifox ahh yes, that would do it thanks. Possibly Twill 2.x used Vue 2 and 3.x is using Vue 3, then?
I
ifox32d ago
No, not yet, we're working on that now but Twill 3 is currently still using vue 2
S
siașamaideparte32d ago
Okay, I reviewed my custom field and and code in each component and it seems to be exactly like the example in terms of structure and implementation. I tried even putting a dd/ray call in the field blade and it's not being called. it seems rather odd to me. I can post up my simple implementation on a gist if that helps at all. It's odd that it's not even calling the field blade though
I
ifox32d ago
Did you run the twill:build command? which version of Twill are you on?
S
siașamaideparte32d ago
3.0. I'll try running it again
I
ifox32d ago
try to update to 3.1, there was a bug with custom components in 3.0
S
siașamaideparte32d ago
Aha, okay, will give it a try
S
siașamaideparte32d ago
Might this be the bug in question?
No description
S
siașamaideparte32d ago
Looks like an Alpine.js implementation somewhere is missing a data object Same issue on 3.2 as well
I
ifox32d ago
the error is weird, that dependency is fine. Which node version are you on?
S
siașamaideparte32d ago
I was on 14 initially when I saw it -- tried to switch to 16 for good measure and same error (reinstalling the deps after switching) Trying 18 now for kicks
I
ifox32d ago
rm -rf vendor/area17/twill/node_modules && php artisan twill:build
S
siașamaideparte32d ago
Same error after that --- only difference was the build process ran for a bit longer than in past after it reinstalled the node modules
I
ifox32d ago
So npm ci is successful now, and error is later? or is it still npm ci failing?
S
siașamaideparte32d ago
It's still npm ci failing If I go back down to 3.0 I get npm ci failing but it's a different set of issues In 3.0 I get errors related to tiptap, it can't resolve a bunch of prosemirror related deps
S
siașamaideparte32d ago
No description
I
ifox32d ago
I'm not reproducing any of this Are you on windows? Hmm no doesn't look like it from your logs
S
siașamaideparte32d ago
Nope, MacOS 13. M1 chip but I'm running terminal in Rosetta. I know build was working before I upgraded from 2.x
I
ifox32d ago
If you go to vendor/area17/twill, which node version do you get. Asking because you may be using something like nvm with a configuration that changes depending on the directory
S
siașamaideparte32d ago
You mean what version is listed in package.json? I'm using nvm but use it universally
I
ifox32d ago
no I mean if you run node --version from that directory
S
siașamaideparte32d ago
I've currently got it at 14.21.2
I
ifox32d ago
I can't confirm if Twill 3 dependencies would install correctly with 14.21.2, but I can always try. What I was trying to check is if your node version is the same when you do twill:build from your project and when you do npm ci manually in the vendor directory I know they do on 16/18/20
S
siașamaideparte32d ago
Got it, yeah. I've tried 16 and 18. I can try 20 as well for what it's worth
I
ifox32d ago
Just tried 16 and 18 on an M1 too successfully, just not in a Rosetta terminal
S
siașamaideparte32d ago
Hmm, i think 20 may have just worked
I
ifox32d ago
there's not much differences in js deps between twill 2 and 3 so this is quite strange oh 🤷‍♂️
S
siașamaideparte32d ago
Yeah it's all pretty weird. I can tell you that I have a knack for finding inexplicable things though. So it's probably on me 🙂 Yeah, ran it again with 20 and it worked fine That's an odd one, but I'll take it! Yep, all fixed. I appreciate the direction!
Want results from more Discord servers?
Add your server
More Posts
Tags in create modalHello! Is it possible to have Tags input in create modal form? Last time I tried, it threw an error.How to get all data from repository?I wanna get all models from repository and show. How to get all data?How to use random links to browser field?I wanna add random link to browser field. How to do that?DatePicker is not working.I have added DatePicker to form builder. And added column to table, field to model... But when I savSave images in multple sizes for responsive?Hi Support Team, I would like to ask if Twill can store the images in multiple size for desktop, mobHow to display image from InlineRepeaterI want to dispaly the image from InlineRepeater. Please help me how to do it.how to upgrade twil 1.2.1 to latest versionhow to upgrade twil 1.2.1 to latest version twill cmsMulti-Select from Dynamic ValuesI created Location Model. And each location has multiple tags. I want to share tags across differeHow should I migrate from Legacy Settings to V3 Settings?I am having trouble accessing the setting goroup I created. When do php artisan route:list, settingCannot use connectedTo: Cannot unpack array with string keysHi I am having issues getting connectedTo to work in my Block. I have Twill 3.1.0 installed, but whasynchronous request in selectGood afternoon, I have two select fields. The thing is that when selecting the first select field, IUpgraded from Twill 2.13 to 3.2, frontend error when saving a module that uses 'editInModal' => trueI upgraded from Twill 2.13 to 3.2. When saving a module that is created/edited via a modal (using $iUpgraded from Twill 2.13 to 3.2, raw HTML links visible in browserHi, I upgraded from Twill 2.13 to 3.2. I am now seeing raw HTML edit links in my "Projecttags" browHow to use Conditional Fields in ControllerI want to add a Author select fields when shared_by === user ` $form->add( Radios::maBlock editor preview Vite issue?Hey all, I'm getting this when I preview a page module block editor in the admin:Upgrading from 2.0 to 3.0 -Block Editor $groups issueHello! I'm getting a strange error (see picture). I've tried clearing all caches. It only happens onInline Repeater get's overridden by another InlineRepeater with the same name in another block.The code in first image get's overriden by the code in the second image in admin panel. Normally, whTable custom columnHello! I created module Product and relationship with module Category. I would like to display categMulti select selected issueIn twill3 I created 2 CRUD, ImportedItem and ItemTypes. I used Multiselect for selecting ItemTypes. Upgrading from 2.0 to 3.0 - routing issuesHello! I'm currently updating twill to 3.0 from 2.0, and I'm having some issues with routes. I'm get