pivot table column values getting set to null

13 views
Skip to first unread message

Jeff Bell

unread,
Jan 31, 2012, 8:42:22 PM1/31/12
to Zotonic users
I have this module http://pastebin.com/c9FXibpB with a custom pivot table.  I can add and edit the resource fine using the listed event/2 functions.  But the pivot columns are not updated correctly.  But if I manually call z_pivot_rsc:pivot_resource(Id, Ctx) with the newly created id, the columns  populate correctly, but then if I edit the rsc again, the values are nulled out again.

I'm banging my head on this one.  I hope this provides enough info to allow you to help me out.

Cheers,

Jeff

Arjan Scherpenisse

unread,
Feb 1, 2012, 8:44:15 AM2/1/12
to zotoni...@googlegroups.com
There is a gotcha with pivot columns:

when a rsc is not publicly visible (for example, not published), the
pivot will put null entries instead of the actual values.

I banged my head on this as well, and do not quite know if this is
actually the desired behaviour. Pivot columns are usefull for
non-visible (e.g. members-only) content as well, I think, since many
custom searches rely on this.

Marc, your thoughts?

Arjan

Jeff Bell

unread,
Feb 1, 2012, 11:41:40 AM2/1/12
to Zotonic users
Thanks, marking is_published to true seems to have done the trick.

Jeff

Andreas Stenius

unread,
Feb 2, 2012, 1:25:48 AM2/2/12
to zotoni...@googlegroups.com
2012/2/1 Arjan Scherpenisse <ar...@scherpenisse.net>:

> There is a gotcha with pivot columns:
>
> when a rsc is not publicly visible (for example, not published), the
> pivot will put null entries instead of the actual values.

Ouch!

> I banged my head on this as well, and do not quite know if this is
> actually the desired behaviour. Pivot columns are usefull for
> non-visible (e.g. members-only) content as well, I think, since many
> custom searches rely on this.

I would find it strange if this is the desired behaviour. I know it is
not for me, anyway.
Not that I use custom pivots at the moment. But eventually I will...

//Andreas

Michael Connors

unread,
Feb 2, 2012, 5:15:03 AM2/2/12
to zotoni...@googlegroups.com
I would not expect that behavior either. 

I use custom pivots a lot, and sometimes I found things got stuck and had to be pivoted manually. I guess this behavior is the culprit. 

Arjan Scherpenisse

unread,
Feb 2, 2012, 5:23:58 AM2/2/12
to zotoni...@googlegroups.com
+1 for removing this behaviour.
But i'd like input from Marc first before I start slashing code :P
Reply all
Reply to author
Forward
0 new messages