Use UID instead of ID in elementGroup field to enable migration of feedme_feeds between environments #911
Unanswered
timbertens
asked this question in
Ideas
Replies: 1 comment
-
Just came here to post this myself. We had a scenario where new Sections and Entry Types were created in a development environment along with the FeedMe rule sets to import them. We manually created a content migration to recreate those FeedMe feeds when we pushed things live but the IDs were different in the production environment so the Feeds had to be adjusted again manually before they worked. I'd love to see:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I'm dealing with a particular setup, about 40 individual sites share the same codebase. Deployment is highly automated because of that, eg. lots of migrations to deal with settings because it is undoable to manually update each and every site.
In this scenario we have build an feedme import (to be able to import a newsfeed to all individual site in a section called 'NewsItems')
To distribute the feedme feeds config the idea was / is to use again a migration to execute a raw SQL statement upon deployment that basically insert a predefined record into the feedme_feeds table. In the FeedMe feed record there is field that stores what elementGroup is manipulated in the FeedMe feed
{"craft\\elements\\Asset":"","craft\\elements\\Category":"","craft\\elements\\Entry":{"section":"4","entryType":"4"},"craft\\elements\\Tag":""}
The field shown above is taken from a development environment. It appears however that the database ID of the newsItems section on dev, test and production environment are different (eg. ID on test is 5 and on production it is 13). Not sure how that comes, but it must have something to do with early development stages where the order of the section creation was changed, just a guess.
The problem is of course that on test and production (the 40 sites) that section ID 4 does not make any sense and FeedMe throws an error upon accessing the FeedMe feeds UI.
Since the sites are using the project.yaml setup, the UIDs of the NewsItems section is always the same, not matter the environment (dev / test or production)
I am wondering why the UID in the elementGroup fields isn't used instead of the ID as it is more reliable. Is this something that makes sense to change, can it be done and will I encounter other difficulties? Or are there better options to do what we would like to do?
Additional info
PHP version 7.3.1
OS version Linux 4.15.0-45-generic
Database driver & version MySQL 5.7.25
Image driver & version GD 7.3.1
Craft edition & version Craft Pro 3.3.20.1
Yii version 2.0.31
Twig version 2.12.3
Guzzle version 6.5.1
Imagine version 1.2.3-dev
Plugins
Activity Log 1.0.1
CodeMirror 1.0.2
CP Field Inspect 1.0.7
Do It Yourself widget 2.0.1
Feed Me 4.2.0.1
Field Manager 2.1.1
GeoField 1.0.0
Imager v2.3.1
Incognito Field 1.1.1.1
Matrix Toolbar 1.0.6
Migration Assistant 3.1.6
No-Cache 2.0.6
Redactor 2.4.0
SEOMate 1.1.1
Site Switcher 2.1.0
Stamp 2.1.0
Table Maker 2.0.1
Two-Factor Authentication 2.4.0
Typed link field 1.0.19
Wheel Form 2.3.4
Wheelform Helper 1.0.0
Wordsmith 3.1.1
Beta Was this translation helpful? Give feedback.
All reactions