"Force default" doesn't hold true to arguments

Rob Loach - February 4, 2008 - 18:34
Project:Viewfield
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The "Force default" is a very powerful feature. It allows you to display any view within a node, without having the user to choose the view. This proves quite useful when you want to create an image gallery, showing all images associated with the given node. To do this, you'd have an image gallery content type and an image content type, using a node reference to the image gallery content types. In the gallery content type, you'd use the view field to display all images associated with the given node using "[nid]" for the arguments with the "Force default" option enabled.

Although it effectively hides which view(s) you can select, it doesn't hide the arguments. When you add a new image gallery content type, you still see the option to change the arguments from "[nid"].

#1

Rob Loach - February 4, 2008 - 18:46
Status:active» patch (code needs review)

The attached patch will effectively hide all the form fields when Force Default is checked (fieldset, views and arguments).

AttachmentSize
viewfield_force_default.patch1.6 KB

#2

moshe weitzman - February 4, 2008 - 22:58
Status:patch (code needs review)» patch (code needs work)

you commented out the 'administer users check. i have been thinking of removing that too. please resubmit with that removed. Further, the best way to do this is to not conditionally define the fieldset but rather add a #access property to it. That way, people who form_alter will see the element and can choose to edit accordingly.

thanks for the patch.

#3

Rob Loach - February 6, 2008 - 17:37
Status:patch (code needs work)» patch (code needs review)
AttachmentSize
viewfield_force_default-2.patch1.58 KB

#4

Rob Loach - February 6, 2008 - 17:47
Status:patch (code needs review)» patch (code needs work)

Having #access hides the settings in the ViewField settings page....

#5

Rob Loach - February 6, 2008 - 17:52
Status:patch (code needs work)» patch (code needs review)

This looks a bit better.

AttachmentSize
viewfield_force_default-3.patch1.64 KB

#6

tostinni - March 5, 2008 - 22:08

Works fine for me, thanks for the patch.

#7

WISEOZ - March 8, 2008 - 15:06

I am on the latest version of Viewfield. I have applied this patch and it has appeared to get rid of some foreach() errors I'd been getting when a Viewfield was included with my node. I'm now seeing the view I'd expect using an argument [nid], but I'm also receiving the following errors on my node that includes a Viewfield:

    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/apache2/htdocs/drupal/modules/date/date_api.module on line 501.

Seems these errors appear with any combination of Force Default, Override checkboxes, and a [nid] argument on the Viewfield configure form. A couple weeks ago I had been getting these errors upon upgrading to the dev version of Date module but in other areas of my site (before I ever used Viewfield). When researching, I found that I needed to upgrade to the dev version of Token to get rid of those errors. That worked then, but now I'm seeing these errors again with the use of Viewfield on a node. Is their some deeper conflict with Viewfield, Date, and Token that I'm picking up on with this error?

Keep in mind that I am a Drupal 5.5 with PostgreSQL implementation.

#8

CoolDreamZ - March 27, 2008 - 11:38

Thanks for the patch, did exactly what I was looking for (all options hidden on node edit page if force default is set in the viewfield configuration), tested OK.

I have another issue (how to hide the view on a teaser) I will start a new thread for that as I couldn't find anything on this)

#9

Expat9 - April 13, 2008 - 15:31

Hello there,
Can we have new stable release of this module please ( previous one is from april 2007)?
I first downloaded 5.1.2 and was looking everywhere for this "force default" option, haha!
Many thanks for this very useful module :)
Expat9

#10

omjn - April 28, 2008 - 03:35

subscribing

#11

Rob Loach - April 28, 2008 - 06:05
Status:patch (code needs review)» patch (reviewed & tested by the community)

Numerous reviews of the patch at #5 returned positive. So setting this to RTBC.

#12

Darren Oh - April 29, 2008 - 16:00
Status:patch (reviewed & tested by the community)» fixed

Fixed in CVS commit 113532.

#13

Darren Oh - April 29, 2008 - 17:03
Version:5.x-1.x-dev» 5.x-1.2

#14

NikLP - April 30, 2008 - 13:05

Please roll 1.3 stable then...? Edit: oh you have, sorry! :)

(also token support, grumble...)

#15

moshe weitzman - April 30, 2008 - 13:03

he did roll 5.1.3. grumble.

#16

NikLP - April 30, 2008 - 13:06

bah, too slow... :)

#17

Anonymous (not verified) - May 14, 2008 - 13:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.