orionjs / orioncms

[Old] Orion is an open source framework built on Meteor that makes complex as well as simple apps possible with minimal effort.
http://orionjs.org
MIT License
715 stars 129 forks source link

Arrays items in dictionnary not reordered #343

Closed weeger closed 9 years ago

weeger commented 9 years ago

First congratulation for these really cool packages.

I create a dict :

orion.dictionary.addDefinition('sentences', 'home', { type: [String], label: 'Blah...' });

Then I fill it manually when my website is initialized :

orion.dictionary.update(orion.dictionary.findOne()._id, {
  $set: {
    home: {
      sentences: [
        "Yow",
        "Hey",
        "Wah",
        "Ugh"
      ]
    }
  }
});

Then I go to my admin interface, remove the first item of the list, and save. The first item is not deleted, I mean because the [0] index of the array is kept is not reordered.

Regards

nicolaslopezj commented 9 years ago

First, you should do

orion.dictionary.update(orion.dictionary.findOne()._id, {
  $set: {
    'home.sentences': [
      "Yow",
      "Hey",
      "Wah",
      "Ugh"
    ]
  }
});

to avoid replacing all the home category.

That problem is with autoform, Orion uses autoform to render forms.

weeger commented 9 years ago

Okay,

Thanks !