Open doctorallen opened 8 years ago
I'm experiencing the same issue. Because TV values are not in the same table, it makes it difficult to do an update import because all TV values not included in CSV file get deleted.
I've dug into it a bit, and I think that it's part of the MODX resource/update
processor. I'm trying to figure out it's possible to prevent the replacement of all of these values using some option but so far I haven't found anything.
Yeah, it definitely is the MODX resource/update processor. It queries all of the modx templateVariables, and either sets their new value to the value passed to the processor, or the default value, when in reality it should be looping over the passed TVs.
What I did was added a new processor that extends the existing processor and overrides the saveTemplateVariables
function. Here is the code for the new processor. I put this in /core/model/mox/processors/resource/
. I then set the importx.processor
setting to updatenooverride
. You still have to pass the alias, parent, and published settings in the CSV, because apparently those get overridden anyway and I didn't care to try and fix that as well.
Here is the example CSV I used:
id;alias;parent;published;tv1
2;test-alias;18;1;value1
I'm reopening this as it is something I'd like to keep in mind for importx v2. :)
I'm using the latest version of importX, and when updating resources, it seems to remove all values that I don't pass in the CSV. I want to update field values, and keep any existing resource and template variables that I have not been passed the same.
I'm digging through the code trying to figure out where I can get this to work, but if someone has experience with doing this, or has done it before, that might save me some time.