ethercreative / simplemap

A beautifully simple map field type for Craft CMS.
Other
136 stars 47 forks source link

Error upgrading from version 3.5.2 to 3.7.5 Exception: Undefined offset #227

Closed briancnoble closed 4 years ago

briancnoble commented 4 years ago

Description

Error occurs on Step 3 Moving existing maps content Logs

1. Creating Maps content columns
- Create content column for Event - Location in content table
    > add column field_eventLocation text to table {{%content}} ... done (time: 11.791s)
- Create content column for Post - Location in content table
    > add column field_postLocation text to table {{%content}} ... done (time: 9.669s)
- Create content column for Marker in matrix pointOfInterest
    > add column field_pointOfInterest_marker text to table {{%matrixcontent_postblock}} ... done (time: 14.320s)
- Create content column for Location in matrix data
    > add column field_data_location text to table {{%matrixcontent_postpointofinteres}} ... done (time: 0.150s)
2. Creating new Maps table
    > create table {{%maps}} ... done (time: 0.041s)
    > create unique index maps_ownerId_ownerSiteId_fieldId_unq_idx on {{%maps}} (ownerId,ownerSiteId,fieldId) ... done (time: 0.044s)
    > create index maps_lat_idx on {{%maps}} (lat) ... done (time: 0.054s)
    > create index maps_lng_idx on {{%maps}} (lng) ... done (time: 0.043s)
    > add foreign key maps_ownerId_fk: {{%maps}} (ownerId) references {{%elements}} (id) ... done (time: 0.151s)
    > add foreign key maps_ownerSiteId_fk: {{%maps}} (ownerSiteId) references {{%sites}} (id) ... done (time: 0.156s)
    > add foreign key maps_fieldId_fk: {{%maps}} (fieldId) references {{%fields}} (id) ... done (time: 0.143s)
3. Moving existing maps content
- Moving Palma de Mallorca, España (5582) to {{%content}}
Exception: Undefined offset: 26 (/home/vagrant/code/affordablemallorca-com/vendor/ether/simplemap/src/migrations/m190712_104805_new_data_format.php:277)
#0 /home/vagrant/code/affordablemallorca-com/vendor/craftcms/cms/src/db/MigrationManager.php(239): ether\simplemap\migrations\m190712_104805_new_data_format->up('???')
#1 /home/vagrant/code/affordablemallorca-com/vendor/craftcms/cms/src/db/MigrationManager.php(159): craft\db\MigrationManager->migrateUp('???')
#2 /home/vagrant/code/affordablemallorca-com/vendor/craftcms/cms/src/services/Updates.php(225): craft\db\MigrationManager->up('???')
#3 /home/vagrant/code/affordablemallorca-com/vendor/craftcms/cms/src/console/controllers/MigrateController.php(265): craft\services\Updates->runMigrations('???')
#4 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\console\controllers\MigrateController->actionAll()
#5 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/InlineAction.php:57}('???', '???')
#6 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams('???')
#7 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/console/Controller.php(148): craft\console\controllers\MigrateController->runAction('???', '???')
#8 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/Module.php(528): craft\console\controllers\MigrateController->runAction('???', '???')
#9 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/console/Application.php(180): craft\console\Application->runAction('???', '???')
#10 /home/vagrant/code/affordablemallorca-com/vendor/craftcms/cms/src/console/Application.php(93): craft\console\Application->runAction('???', '???')
#11 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('???', '???')
#12 /home/vagrant/code/affordablemallorca-com/vendor/yiisoft/yii2/base/Application.php(386): craft\console\Application->handleRequest('???')
#13 /home/vagrant/code/affordablemallorca-com/craft(22): craft\console\Application->run()
#14 {main}
Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Maps.'

Steps to reproduce

  1. run composer require new version
  2. go to site admin
  3. immediately see SQL column not found error
  4. run craft migrate/all

Additional info

Tam commented 4 years ago

@briancnoble Can you email a database dump to dev@ethercreative.co.uk? Also, am I correct in thinking you're using MySQL?

briancnoble commented 4 years ago

Yes we're use MySQL. No problem giving you a DB dump. Would you be willing to sign an NDA?

Tam commented 4 years ago

@briancnoble I've pushed a fix for your issue. You also have an errant maps table in your database, you'll want to drop that before migrating.