I get errors when pressing the button to create another node.

First I got a bunch of errors about CCK Fieldgroup Tabs ... so I disabled that and then received the following errors.

    * warning: Invalid argument supplied for foreach() in \sites\all\modules\cck\includes\content.node_form.inc on line 320.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in \sites\all\modules\cck\includes\content.node_form.inc on line 346.
    * warning: Wrong parameter count for max() in \sites\all\modules\cck\includes\content.node_form.inc on line 346.

The template form does not appear .... only the warnings

Also when I try to set my AC_TEMPLATE's to unpublished and save it doesnt set and remains published.

CommentFileSizeAuthor
#8 autocreate.module.txt9.23 KBsunset_bill

Comments

Macronomicus’s picture

Does this module require CCK 6.x-2.x-dev ?
I am using CCK 6.x-2.1

sunset_bill’s picture

Assigned: Unassigned » sunset_bill
Status: Active » Postponed (maintainer needs more info)

The port to 6.x was done with CCK 6.x.2.1 so you're OK there--I'm assuming you are already using CCK, right? ;^)

I can't really tell what's going on from the log snippets--the warnings in question don't look familiar, anyway. Invalid argument in foreach() suggests a field being submitted with a null value.

What kind of node (webform or group) are you trying to create a reference for?
What's the title of your template node?
If you're autocreating a group, what's the ANR field name and the content type (machine-readable name) of your group node?

Published/unpublished for template nodes is a 3-part thing:
E.g., a group node, for a user to start a new group, is published by default (set in the content type itself), but a template group node should be unpublished (set in Content management > Content). A group node cloned from said template, however, is an actual group now, and so should be published (set in Site configuration > Clone module, publishing options for the group node type should be reset to defaults).

ciao,
Bill

Macronomicus’s picture

Yeah I am using cck.

Q: What kind of node (webform or group) are you trying to create a reference for?
A: It is a custom content type created with cck It has very basic fields, nothing fancy.
Basically its just a node record of a computer profile of one of the computers we support for a given client.

Q: What's the title of your template node?
A: Standard AC_TEMPLATE

Published/unpublished for template nodes is a 3-part thing:
I did what you said ... unchecked published from the default options at admin/content/node-type/profile-computer
And then went to admin/settings/clone and checked off [Computer Profile: reset publishing options when cloned]
Still when I edit my [ Standard AC_TEMPLATE ] and uncheck published from the workflow settings and click save ... it remains published.

FYI: I still get the same errors weather selecting [Pre-populate the node form fields] or [Save as a new node then edit] in the clone settings page.

I am presently using the http://drupal.org/project/popups_reference module to achieve a quasi-similar effect.
Though your method is potentially superior since it auto selects the node being created, so there's no need to fuss with selects!

We are putting together a crm portal of sorts for a tech support co.
The process of your module integrates several things for me.

  1. User can easily create support/service/etc requests of diff types attached to them
  2. User can easily create computer/server/etc profiles of diff types attached to them
  3. Have the staff ability to create these and attach them to users easily.
sunset_bill’s picture

Category: bug » feature
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Active

Thanks for the additional info, that helps a lot.

In its current incarnation, the ANR module is specifically set up for handling webforms and Groups. An OG node, though, is nothing but a content type until you tell OG about it. As far as the ANR module is concerned, it's just a non-webform node to link to. So, what might work in your case is to set the content type (machine-readable version) of your Standard AC_TEMPLATE as the type of the OG node in Site configuration > Autocreate nodereference and as the field name of the ANR field in your CCK type.

Note that this will only get you a link to a node cloned from Standard AC_TEMPLATE. Regardless of config settings for Clone node, you will then need to manually go in and edit the resulting clone, you won't get a node edit form for the clone when you create the content that creates the clone.

I don't know if that provides the overall flexibility you're hoping for, since it limits you to a single referenced type, which doesn't seem like it satisfies #'s 1&2 on your list. I'll look into handing other content types, but no promises.

cheers,
Bill

PS--If you enjoy this module and appreciate the effort, please visit http://rageagainstthecubefarm.com and click on one of the ads. ;^)

Macronomicus’s picture

Oh I didnt realize that it needed to be an organic group. Is there something particular about an organic group node you are relying on?

I had started this off by creating content types for the different things like Support Request and Computer Profile. And was cloning the node add form with ccks node_reference and popups_reference modules to add multiples of these types to a customer .. bit annoying though as the items have to be selected in a multiselect, and lastly attaching them to the users profile area with content_profile mod.

Although since my last post things have changed a bit and I have realized I am re-inventing the wheel a tad bit... as the other software we are using GoToAssist has a great API integration and we will naturally be able to attach a lot of the relevant data to our users in drupal. Prolly going to have to write a module to integrate the two and hire a few more folks on my staff cause I cant get no sleep!! lol....

Thanks for your response though, I still look forward to seeing how your module progresses because its an exceedingly useful idea!

I clicked a bunch of your ads too, because I love a shameless plug! ^_^

sunset_bill’s picture

Alright, thanks for the support. :)

No, there's no reliance on groups at all. I wasn't really thinking about it during development, but what ANR knows about is that it's creating a reference to either a webform or some other content type. The ANR configuration page has settings for a webform and a group because I'm using the module to create references to those two things in the same CCK type and needed a way to tell them apart, but you can trick ANR into referencing any content type by using the group settings--it'll never know you're not actually referencing a group.

(The only thing special about a group node content type is that you've told OG about that content type, so OG creates a new group when you post something of that type--but that's all in OG.)

Shameless Plugging ;^) -- I'm available on a contract basis if you need some help. You can reach me via the Contact Us page on RATCF.

Macronomicus’s picture

Ok I will try that with the og bits in.

I have been tinkering around with OG for a week now. I'm thinking of using it to group our various tech supporters together so they can share and interact; that and the other different arms of the company too. This will be especially useful as we've offices all over the globe and telecommuters as well. I really like the idea of drupal being the central node bringing everyone together.

Thanks for the offer of dev help, I will keep you in mind!

Cheers!
^_^

sunset_bill’s picture

StatusFileSize
new9.23 KB

OK, I've made ANR a little stupider, so now it doesn't know anything about content types and treats all types the same, as you will immediately notice on the config page. This means you can now autocreate references to any type, from Drupal defaults to module-generated types like webforms to your own CCK types. All you need to do for a type you want to create references for is provide a suffix on the ANR config page, create a template for that type, and add an ANR field with the content type as the field name and using the appropriate template for the type. Do be aware that in the case of anything but a webform, though, you will still need to go in and manually edit the newly cloned and referenced node unless your template content is good enough to be used everywhere. ;^)

New changes should show up when the 8 Feb dev snapshots come out (both 5.x. and 6.x), but since I don't trust my CVS, the latest&greatest autocreate.module file for 6.x is attached.

And thanks for the inspiration! Methinks it's a much more useful module now. ;^)

Oh yeah, those warnings in the initial post? ANR was looking for a group or a webform template and not finding either one, which threw a NULL into your foreach().

ciao,
Bill

Macronomicus’s picture

I think I am still having the same issue .... I cannot make my template file unpublished, which is weird!
and when clicking [Add another item] I get the following errors.

    * warning: Invalid argument supplied for foreach() in C:\wamp\www\mysite.com\sites\all\modules\cck\includes\content.node_form.inc on line 320.
    * warning: array_keys() [function.array-keys]: The first argument should be an array in C:\wamp\www\mysite.com\sites\all\modules\cck\includes\content.node_form.inc on line 346.
    * warning: Wrong parameter count for max() in C:\wamp\www\mysite.com\sites\all\modules\cck\includes\content.node_form.inc on line 346.

What do you think could be causing me not being able to unpublish my AC_TEMPLATE file?
Do you think the "published" status of my AC_TEMPLATE file could be whats making this thing not work for me?

Macronomicus’s picture

Ok so I went into the db and set the status of the template node to unpublished which did stick ... but I am still getting the same errors. So I guess its not that

sunset_bill’s picture

Category: feature » bug

Hmmm, that is weird. I have no idea what's going on with not being able to set your template node(s) as unpublished, but I'm sure it's not this module. An ANR template node's just an ordinary node of some content type, which happens to have a user-defined string in the title that ANR pays attention to. There's nothing special about it at all that should prevent you from being able to turn off publishing and/or promotion when you create a template.

So, back to those ugly foreach() errors...where exactly are those happening? Is it when you try to add an ANR field to your CCK type, or when you try to create content using a CCK type that has an ANR field in it? If it's when trying to create content, is it when the the node/add page opens, or after you hit Save? And, of course, do they go away if you remove your attempted ANR field from the CCK type?

Also, are you using Autocreate 6.x-1.1 now? The 8 Feb releases (official and dev are the same) get rid of all webform/group specificity, which at least eliminates one more possible cause of trouble.

sunset_bill’s picture

Not having any luck at all trying to get any of these warning messages myself. Tried:

1. Adding a field with an invalid type, "webfrom", as field name and with no template node selected (blank select list in field configuration).

2. Added a field with an invalid type, "sleeze_ball", but now with a valid template node, "Profile 1 AC_TEMPLATE".

3. Added a field with a valid type, "profile_1" but no associated template node.

In all three cases, I was able to create/manage content types and create content. I didn't get working node references, but I also didn't get any warnings at all from either content type management or node/add, which, along with being unable to set a node to unpublished, really makes me suspect a problem with your current CCK download.

Macronomicus’s picture

Hmmm .. I will have to check that out ... sorry I have been buried in work and didnt have time to get back to you.
I will diff my cck bits and make sure their proper, and then try this again to map out the errors better (if any) I hope your right about the cck issue!
I am using CCK 6.x-2.1 do you require the CCK dev version?

Cheers!
^_^

sunset_bill’s picture

I'm using CCK6.x.-2.1, so it's not a version thing. It might be your ANR download, too, and not CCK. I'd recommend trying 6.x-2.x (of ANR) first. It's a dev version but I'm done working on it outside of bug reports. It might actually be a little more useful for something like the profiles you've described, since it lets you define fields so as to use, say, one Profile template in one content type (like Vendor) and a different Profile template in another content type (like Hardware)--how-to is all in http://drupal.org/node/371518.

Real perplexing, not being able to recreate a problem!

salud,
Bill

sunset_bill’s picture

Status: Active » Closed (fixed)

2 weeks w/o activity

squarecandy’s picture

Title: Error ... does not compute ^_^ » Disable Fieldgroup Tabs = Invalid argument supplied for foreach() in cck/includes/content.node_form.inc
Project: Autocreate Node Reference » CCK Fieldgroup Tabs
Version: 6.x-1.0 » 6.x-1.x-dev
Status: Closed (fixed) » Active

I also am having this exact problem - I'm using CCK 6.x-2.x-dev, but I'm thinking that this is related to the dev version of the CCK fieldgroup tabs and how it interacts with CCK... Just like in macrocosm's original comment, I had CCK fieldgroup tabs installed. I then disabled it, and started having this problem. @sunset bill, did you try installing, then disabling CCK fieldgroup tabs in trying to recreate the problem?

* warning: Invalid argument supplied for foreach() in /var/customers/webs/berkfilm/sites/all/modules/cck/includes/content.node_form.inc on line 328.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/customers/webs/berkfilm/sites/all/modules/cck/includes/content.node_form.inc on line 336.
* warning: Wrong parameter count for max() in /var/customers/webs/berkfilm/sites/all/modules/cck/includes/content.node_form.inc on line 336.

I'm getting the error with "unlimited" field quantities where you can "add more" - there should be one field to start with and there are none. When you press "add another item" the error occurs.

Thanks in advance for any help anyone can offer.

sunset_bill’s picture

Assigned: sunset_bill » Unassigned

Unassigning myself to go along with the project change from Autocreate Node Reference to CCK Fieldgroup Tabs. This appears to have something to do with the Autocomplete and field quantity options in a Node Reference field. That's official CCK there, and I'm going to leave it for those who really know CCK.

luck!
SB

squarecandy’s picture

Status: Active » Closed (fixed)

found the culprit - moved here:
http://drupal.org/node/300084#comment-1628396