-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing an empty string to an existing value doesn't overwrite that value #797
Comments
We are experiencing this same issue. An empty string in the import data results in no changes to the field's existing data. |
Same issue here. Subsequent importing of a JSON feed where a value for one field is changed from a defined value to null or "" (blank) results in the previous value remaining and not being updated with the new null or "" (blank) value. |
Same here. |
An easier solution would be to use the use craft\feedme\events\FieldEvent;
use craft\feedme\services\Fields;
use yii\base\Event;
Event::on(Fields::class, Fields::EVENT_AFTER_PARSE_FIELD, function(FieldEvent $e) {
if ($e->parsedValue === "EMPTY") {
$e->parsedValue = "";
}
}); |
I got the same issue. We are using a forked version of the plugin anyway and our solution is modifying the DataHelper-class. I'm providing a pull request soon. |
When will this feature be available as an upgrade from the Craft CMS plugin store? |
I've been waiting for months for this feature and my clients are getting more and more impatient... this is an issue that really needs fiksing. Is there a workaround in the meantime? |
I had to take a pretty crappy approach of changing the feed I was importing to output |
can someone please fix this issue? we have a lot of problems due to this not being properly handled |
According to what I heard on one of the talks of dotAll (I believe 🤔) I think Brandon said they were looking into not investing a lot more time into Feed-me in the future, but looking into a new approach etc. for content migration in Craft 4. Haven't seen an update on this since last year though. Basically. I wouldn't count on this to ever get fixed. |
@mdoorschodt |
yes i did. not a big fan of forking, as updating/upgrading will be an issue later on. I just don't get it that merging a bugfix is such a problem |
Also related #723 @angrybrad @olivierbon could we get this looked at? Would close at least 3 issues and 2 pull requests. |
Yeah, I was thinking about a non breaking space… just as crappy
Mark Doorschodt - Projectleider
Tel: +31 (0)651839574
Zicht online & Fabrique
Weena-Zuid 108 / 3012 NC Rotterdam / NL
www.zicht.nl<http://www.zicht.nl> en www.fabrique.nl<http://www.fabrique.nl>
Op 9 mei 2022, om 12:44 heeft Nick Dunn ***@***.******@***.***>> het volgende geschreven:
I had to take a pretty crappy approach of changing the feed I was importing to output "None" instead of nulls or blank strings, and check for this value in my template to treat as a blank.
—
Reply to this email directly, view it on GitHub<#797 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABJZZMJ7STOMWUSOXI2O7ELVJDUBJANCNFSM4XAL2AMA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
+1 for this feature |
@brianjhanson not sure if this is on your radar but taking a look at this issue would be great! |
Resolved in #1228 |
Feed Me 4.6.0 (Craft 3) and 5.1.0 (Craft 4) have been released with the new “Set Empty Values” setting, which resolves this (via #1228) 🎉 |
Happy St Pattie's day everyone! |
@brandonkelly unfortunately this change only partially fixes this issue for us. It seems that the PR makes no difference between an empty value and a non-existent value. Ie, let's say you want to import this XML via Feedme:
Now let's say
|
Description
When the data in your API gets updated so a field has a new value of an empty string but it previously had a proper value, Feed-me simple ignores it and there is no way to update the entry to reflect the new data. I know values that are set to null are being ignored by Feed-me, but an empty string is a valid value and shouldn't be ignored.
Think this is where this behaviour is implemented:
feed-me/src/services/Process.php
Lines 358 to 367 in d6817eb
The code suggests it only checks on
null
but empty strings are parsed somewhere I believe to be set to a value of null if they are empty.Maybe there are arguments to be made that sometimes you would like this behaviour, but it would be very handy to be able to set this as a settings option and not a default you have to hack your way around. At the moment the only way around this we found is by doing something like this:
Then looping over all the fields and do the checking ourselves, based on a keyword EMPTY, setting that value manually.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: