[ubiquo_design] Expected behaviour when updating positions of non valid widgets

7 views
Skip to first unread message

Bernat Ràfales

unread,
Jan 25, 2012, 6:39:21 AM1/25/12
to ubiquo...@googlegroups.com
When using an out of the box 0.8-stable ubiquo with ubiquo_design, the widgets can't be repositioned in a page at design time if some widgets are not valid. I don't know if this is an expected behavior or not.
Everything seems to work (there's no nasty error) but the positions of the widgets are not updated.
The problem has been localized in the method that changes the order in the widgets controller:

widget.update_attributes(:position => index, :block_id => block.id)

This call returns false and the position is not updated because the widget validation fails.

We should consider if this is the expected behaviour or if we should update the attributes and save the object without validation instead.
Also, if there are both valid and invalid widgets in a block, this might lead to strange positioning statuses in the database since the valid ones would keep the wished position and the invalid ones wouldn't

I personally think that regardless of the valid or invalid status of widgets in a page, they should be repositionable

Cheers!

--
Bernat Ràfales
braf...@gnuine.com

gnuine
www.gnuine.com
C/ Pamplona, 96
Local 17
22@ - 08018 Barcelona

Tel: +34.93.567.94.94
Fax: +34.93.567.94.95

Bernat Foj Capell

unread,
Mar 22, 2012, 7:04:46 AM3/22/12
to ubiquo...@googlegroups.com
Hi,

I believe that a widget is not saved if there are validation errors,
so how would you reposition it if you can't save it?

Cheers,
Bernat

> --
> Heu rebut aquest missatge perquè esteu subscrit al grup "ubiquo" de Google
> Grups.
> Per publicar a aquest grup, envieu un correu electrònic a
> ubiquo...@googlegroups.com.
> Per anul·lar la subscripció a aquest grup, envieu un correu electrònic a
> ubiquo-gnuin...@googlegroups.com.
> Per obtenir més opcions, visiteu aquest grup a
> http://groups.google.com/group/ubiquo-gnuine?hl=ca.

--
Bernat Foj Capell
bf...@gnuine.com

Bernat Ràfales

unread,
Mar 22, 2012, 9:41:02 AM3/22/12
to ubiquo...@googlegroups.com
That seems like a plausible explanatio and in fact I think this would be hard to solve. So I get it's ok to leave it like that.

Cheers.
Reply all
Reply to author
Forward
0 new messages