(2016-02-01, 01:59:42)xrmarcis Wrote: Feature request:
Bulk update tool - Used to update all records in a category when category fields have been added after there have been items created in the category.
I recently ran into this today while creating filters and could not understand by my items were not filtering properly. I figured out when i went back into a previously created item and just updated it. Its started appearing in my filtered item list.
Thank you for the great plugin.
You can add as many additional fields as you like, even after there have been items created in the category.
I do not think that it’s a good idea to allow IM to modify field values of all items that’s being stored, on every time a new category field is created.
And of course you can already do it very simple by using ItemManager API.
For example, to set all the values of your „single“ checkbox to checked, you can use following code:
PHP Code:
$manager = new IManager();
$catItems = $manager->getItemClass();
$catItems->init(2);
if($catItems->items)
{
foreach($catItems->items as $item)
{
if($item->setFieldValue('single', 1))
{
$item->save();
}
};
};
That it’s your Bulk update tool lol
Is not it easy? Now try the same with an ugly array ;-)