Clarity Posted October 24, 2023 Share Posted October 24, 2023 Hello! I would like to report an issue I noticed. I migrated a FieldtypeCombo field using the RockMigrations module. The field was transferred with the warning: FieldtypeCombo: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_global_settings_combo.i3' in 'field list'. To figure out this error, I exported this FieldtypeCombo field and compared the database state in both cases. After a normal export, the database looks like this: After migrating using RockMigrations, the database looks like this: As you can see, the database is missing columns "i3", "i4", "i5", "i6". Can you please tell me how it is possible to create them? Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted October 25, 2023 Share Posted October 25, 2023 @Clarity, Combo is a 1st party Pro field and it seems to be not supported out of the box with Rock Migrations. I think that only Repeater Matrix field is supported of all Ryan's Pro fields thanks to @gebeer's work. Those Pro fields all need special treatment and you can't expect them to work with just createField(). But you can always fall back to just raw ProcessWire api and create the Combo field with just that. See here how to do it if you got Pro fields support board access. If you don't, here is the code Ryan suggested (hope this is alright to post it here): You can make a special method for Rock Migrations out of this (should be pretty easy if this code works) and make a PR if you want it there)) 1 1 Link to comment Share on other sites More sharing options...
Clarity Posted October 26, 2023 Author Share Posted October 26, 2023 22 hours ago, Ivan Gretsky said: @Clarity, Combo is a 1st party Pro field and it seems to be not supported out of the box with Rock Migrations. I think that only Repeater Matrix field is supported of all Ryan's Pro fields thanks to @gebeer's work. Those Pro fields all need special treatment and you can't expect them to work with just createField(). But you can always fall back to just raw ProcessWire api and create the Combo field with just that. See here how to do it if you got Pro fields support board access. If you don't, here is the code Ryan suggested (hope this is alright to post it here): You can make a special method for Rock Migrations out of this (should be pretty easy if this code works) and make a PR if you want it there)) Thank you, it indeed works! 1 Link to comment Share on other sites More sharing options...
gebeer Posted October 27, 2023 Share Posted October 27, 2023 On 10/25/2023 at 11:13 PM, Ivan Gretsky said: thanks to @gebeer's work. actually the main work for this was done by @bernhardfor his old release RockMigrations V1. I just ported that to V2 and added some improvements/bugfixes :-) 3 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted October 27, 2023 Share Posted October 27, 2023 Thanks to both of you! We are now able to manage RM fields which is super important for at least my workflow. Maybe eventually we will get methods for other Pro fields (or at least workarounds like this one))) 1 Link to comment Share on other sites More sharing options...
gornycreative Posted November 30, 2023 Share Posted November 30, 2023 I did not realize this was an issue. I was able to import a combo field using the declared field parameters. My code for this particular field looks like the following as a field in the ['fields'] array of the migrate() method call: 'publication_details' => [ 'label' => 'Publication Details', 'flags' => 0, 'type' => 'FieldtypeCombo', 'i1_label' => 'Volume', 'i1_name' => 'volume', 'i1_type' => 'Text', 'i2_label' => 'Issue', 'i2_name' => 'issue', 'i2_type' => 'Text', 'i3_label' => 'Year', 'i3_name' => 'year', 'i3_type' => 'Integer', 'i4_label' => 'Period', 'i4_name' => 'period', 'i4_type' => 'Select', 'qty' => 4, 'hideWrap' => 0, 'useColNames' => 0, 'modSchema' => 0, 'useDataCol' => 0, 'i1_ok' => 1, 'i1_collapsed' => 0, 'i1_minlength' => 0, 'i1_maxlength' => 3, 'i1_showCount' => 0, 'i1_size' => 3, 'i1_stripTags' => 1, 'i1_columnWidth' => 25, 'i2_ok' => 1, 'i2_collapsed' => 0, 'i2_minlength' => 0, 'i2_maxlength' => 3, 'i2_showCount' => 0, 'i2_size' => 3, 'i2_stripTags' => 1, 'i2_columnWidth' => 25, 'i3_ok' => 1, 'i3_collapsed' => 0, 'i3_inputType' => 'number', 'i3_size' => 4, 'i3_min' => 1600, 'i3_columnWidth' => 25, 'i4_options' => '= Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Quarter Q1 Q2 Q3 Q4', 'i4_ok' => 1, 'i4_collapsed' => 0, 'i4_columnWidth' => 25, 'order' => '1,2,3,4', 'notes' => 'Include original publication details here.', 'columnWidth' => 100, ], ], Do note that for the options in order to preserve the options formatting the tabs are specifically positioned. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now