pushtype / push_type

PushType is a modern, open source content management system for Ruby on Rails.
http://www.pushtype.org
Other
290 stars 32 forks source link

Matrix field that has a :relation type that is multiple does not save properly #55

Open kwyoung11 opened 5 years ago

kwyoung11 commented 5 years ago

Matrix fields with relation sub fields that allow multiple values do not seem to be working properly.

Create a Relation, for e.g.

class Note < PushType::Node
  has_child_nodes :false

  field :content, :wysiwyg
end
class Klass < PushType::Node
  has_child_nodes :false

  field :notes, :matrix do
    field :note_ids, :relation, multiple: true
  end
end

STR: 1) Go to CMS. 2) Create multiple different Note objects and give them whatever content you like 3) Create a new Klass object 4) Add a Note object to the first row in the matrix 5) Click "+Add row" to add a new row to the matrix 6) Add another Note object to the newly added row (the second row) 7) Publish the Node

Expected behavior: Note objects remain in their prescribed rows in the matrix

Actual behavior: The second note object from the second row moves up to the first row, and the second row in the matrix becomes blank