Download & Extend

Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit

Project:Panels
Version:6.x-3.0-alpha2
Component:Panel pages
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I am using Firefox 3 and following this Panels 2 documentation page (http://drupal.org/node/201916) step-by-step, so hopefully it is easily recreated. At step 9 the pop-up window shows the following error message (twice):

warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\drupal\includes\form.inc on line 1189

If I ignore these and continue, the override does not work, nothing happens. I am not sure whether this is a bug or just a matter of a document that is out of date, so I am filing it as a support request for now.

Comments

#1

No feedback.. does this mean noone else is experiencing this issue? If you did, I'd appreciate any pointers.

#2

Status:active» postponed (maintainer needs more info)

Bugs, if anything - it's an alpha release. I've fixed some of the bad args to foreach errors, but this one seems new; however, I'm having difficulty replicating it seems to be working fine on dev sandbox. Try the -dev release, see if that fixes it?

#3

I've tried this again with the latest version (6.x-2.0-alpha2), but still the same. I am using a clean install and follow the steps in the documentation to the letter. I am not sure why this is working in dev sandbox but not for me...

#4

Version:6.x-2.0-alpha1» 6.x-2.x-dev

I am using 6.x-2.x-dev and I get same error
on a clean drupal 6.6 install

* warning: Invalid argument supplied for foreach() in G:\xiosweb\td6\includes\form.inc on line 1194.
* warning: Invalid argument supplied for foreach() in G:\xiosweb\td6\includes\form.inc on line 1194.

I know the tutorial is for 5.x but
I have succesfully done a node_override
as guided by this screencast
http://blip.tv/file/600413 (after middle of the screencast)
which explains a stripped down version of this tutorial
http://drupal.org/node/206185

thus the problem seems to be with SOME "arguments"

When I try to add an "argument" in the "context" tab
for anything other than "Node ID" and "User ID"
I get same warnings on the popup window
but when I "edit" the arguments I don't get the warnings !!!!

#5

Status:postponed (maintainer needs more info)» closed (duplicate)

Marking as duplicate of #323489: Invalid argument supplied for foreach()...

#6

Status:closed (duplicate)» active

Sun, I'm doing the contrary : marking #323489 as a duplicate of this one, since this issue has been filled in for 6.x-2.x-dev and the other issue is younger and for 5.x-2.0-rc1a.

I can confirm the problem on 6.x-2.x-dev (build 2008-Dec-29) when trying to use a taxonomy term as an argument.

Can someone try to reproduce it :

- add a single column panel page
- name it paneltermtest and choose the path paneltermtest/%
- in context choose taxonomy term and add
- you get the popup with twince the warning :

warning: Invalid argument supplied for foreach() in .../includes/form.inc on line 1193

Then I get this if I try to go on despite the warnings and add the argument :

warning: array_merge() [function.array-merge]: Argument #1 is not an array in .../sites/all/modules/panels/panels_page/panels_page.menu.inc on line 216.

And when trying to access the panel, for example at http://www.example.com/paneltermtest/59 where 59 is an existing term ID, I get an access denied.

This is with or without adding any content to the single column panel.

#7

Title:bug or docs out of date? Context - Add argument returns warnings» Broken arguments : Taxonomy term, Vocabulary ID, Node add form and Node edit
Category:support request» bug report

I reproduced my test with all the possible arguments. The warning is there with :
- Vocabulary ID
- Node add form
- Node edit form
- already mentionned Taxonomy term

Marking this as a bug and changing the title.

#8

Version:6.x-2.x-dev» 6.x-2.0-alpha3

Still present on alpha3.

#9

#10

Subscribing, filed posisble duplicate looking for this thread progress now.
Thanks a lot for allready your great work on panels D6. Hopefully the arguments bug is not a big one.
Greetings, Martijn

#11

Taxonomy term context broken for me too, latest -dev

#12

I've not seen the warning, but did get the Access denied for various node/xx/edit pages. The add pages seem to work, which is why it took some time before I noticed the problem.

- I created a panel page at url node/%
- I've configured it so it responds to a content type "News"
- I go to content (admin / content mgmt / content) and press edit on a different content type (e.g. Image)
- For some reason, the panel page is invoked! node/15/edit routes to node/% and generates an Access Denied error.
- However: The edit screen for "News" content items works fine

I've traced the error to index.php, drupal_access_denied() due to a MENU_ACCESS_DENIED returned by menu_execute_active_handler()

Hope this info helps!

#13

Hello dynamind,

I don't think your problem is related to this issue. With a panel created at the url node/% you're trying a node override with a panel. I've seen issues reported with problems like that, try to have a look at "node override" issues for panels (look also in the fixed issues, I remember seeing a fixed issue like that).

#14

Subscribe

#15

I m also having this error but my module is working fine but tell me how can i remove this error is there any posible way to remove this i have spent lots of time on it but did nt find any solution....any one know about how to remove this error..

the error is ......
* warning: Invalid argument supplied for foreach() \includes\form.inc on line 1193.
* warning: Invalid argument supplied for foreach() in \includes\form.inc on line 1416.

#16

Anyone knows what is going on here please. I can;t get my fingers behind it..so to speak.
Thanks a lot for going into this!
Greetings,
Martijn

#17

Subscribing

Same problem here....

Best regards,
Wilton

#18

This has been causing me problems for a while (I guess thats what we get for using alpha's). My temporary workaround is making the panel with a static path (no %'s) and pass/grab arguments using the url and arg() function. Of course it is a lot more work to recreate 'context' information this way, but it usually suffices.

The problem is I cannot override non-node pages, and it is a lot messier and less intuitive, and prevents using pathauto urls. *waiting anxiously for alpha 4, or better yet a RC*

#19

Subscribing

#20

Some digging I've made, hope it helps in resolving the issue.

the warning: Invalid argument supplied for foreach() in .../includes/form.inc on line 1193 does not seem to be significant in any way, nor responsible for the access denied error. It's just default values for the checkboxes that are incorrect.

Views seems to be partly responsible for the access denied error.

When the panels_page_menu_alter is called, views have already changed the callbacks, and the path "taxonomy/term/%" has been replaced with "taxonomy/term/%views_arg"

When changed views weight to a higher value than panels, the paths seem to be build correctly, and the access denied goes away? However you cannot panelise a path used by views. Note: You must save your panel after changing module-weight, before the paths are working.

Can anyone confirm this?

#21

I had this same problem as well (foreach errors) when first selecting, when trying to use taxonomy as an argument. The error is not there if I go back to edit. In addition, the "Context" operation always resets to the first vocabulary.

To test whether this was the problem with my arguments, I created a panel page for that vocabulary type. While it then accepted and properly displayed a block with the taxonomy description (yay!), it would NOT pass this argument to the view I had included. Entering the argument into views directly works fine for both default and page types.

Obviously, a similar scenario for a vocabulary type or content other than the first one listed in context doesn't produce anything at all.

I am using taxonomy ID's for everything - taxonomy names don't really seem to work reliably with Views at all for me.

Has there been any progress? Seems like a key and popular problem. This functionality working properly would solve a ton of problems related to taxonomy and different content types, which is my only constant headache with Drupal.

Thanks!

#22

Hi every one ,
I am also having this same issue before many days and today i debub how can i solve this issue actually i was having error ....
warning: Invalid argument supplied for foreach() in \includes\form.inc on line 1193.
I am having this issue and when i debug and comment the code of checkboxes in my module than this error is resolved but i have to use this checkboxes ,check my code if i m missing some minor code and tell me how can i solve this ..

$form['payment_options']['business_payment_method']= array(
'#type' => 'checkboxes',
'#title'=> t('Payment Options'),
'#default_value' => variable_get('business_payment_method',$selected_payment),
'#options' => $payment_options,
);
I am using this tell me if you understand how can i solve this issue ...

Thanks in Advance

Azhar
4 Ace Technologies(www.4acetech.com)
karachi,Pakistan

#23

I'm having this exact problem as well. Using taxonomy term arguments for panels produces:

warning: Invalid argument supplied for foreach() \includes\form.inc on line 1193.

And then I cannot view the panel page even as user 1;

#24

it is the problem coming from you from the code of checkboxes ,comment one by one checkboxes than check which checkboxes showing you this issue and send me that checkbox code,,

#25

To clarify my problem, it's the Contexts that are the major problem for me now. I can only select and save the first Vocabulary. For some reason it is not saving any settings I make there. The Panels I set up that actually use that vocabulary seem to work fine, so if that is fixed I think I am good to go.

Just wanted to make sure I had this in the right Issue. Thanks!

#26

marked http://drupal.org/node/361734 as duplicate of this issue

#27

The project page states that panels 6.x-2.x will likely not get out of alpha

6.x-3.x-alpha2 is out however. It looks like the new version no longer throws 'access denied' errors, however it does not properly handle non node-id contexts (which is actually handled by CTools now). There are no errors, it just doesn't display %tokens or any other context specific info.

Based on my initial impression however the new Panels 6.x-3.x is still more broken than 6.x-2.x, so I would not switch in any case.

Despite the problems Panels 3 + Ctools looks amazingly promising.

#28

Here is a temporary work around for this issue which might help in certain cases.

If you are attempting to display a view which uses taxonomy term arguments in a panel layout, you can bypass the panel term id context issue.

1. Instead adding a term ID context to your panel, add a node ID context. (if you don't choose a context you will get a 'page not found error' and if you choose term ID you will get the ' accessed denied issue')

2. Add your view pane under the 'content' tab as per usual. But don't edit any fields relating to context or arguments.

3. Now edit your actual view. Open the settings for your view argument.

4. Under "Action to take if view argument is not present", select 'provide default argument'.

5. Under "Default argument type", select 'PHP Code'.

6. Under "PHP argument code" type: return arg(2); (or whatever number argument your after) and save your view

Hope this is a useful.

#29

Hi,

I am a little bit confused.
Panels 2 alpha... will this issue be resolved?
Or do we have to go with Panels 3 and then use another approach?

I have drupal 5 site which is working great in combination with panels/views and argument handling, but I am not able to get it to work the last 3 months in D6.

EDIT: I went to Panels 3, and it is starting working again.. for people with access problems this post is handy: http://drupal.org/node/386774#comment-1302660

Thanks a lot for elaborating more on this!
Greetings,
Martijn
www.trekking-world.com

#30

Subscribing...

#31

Status:active» postponed (maintainer needs more info)

Thanks dan_lennox for the workaround !
I suggest we give away this issue on 6.x-2 since 6.x-3 is the future.
If you're all right with that, I assign the status active (needs more info) until someone tests this under 6.x-3.

#32

I am getting the following error When I try to give an argument in the path for a new Panel Page:

warning: array_merge() [function.array-merge]: Argument #1 is not an array in \sites\all\modules\panels\panels\panels_page\panels_page.menu.inc on line 216.

Here is the value for path that I am using
Path: game-category/%

Is this related to the issue being discussed here?

Anyways I am able to work with this though.
Instead of using Contexts I am just using the first argument and it's working fine as I am using the same argument in my Views which I am embedding in my Panel.
Except for the error messages that get displayed every once in a while, everything works...

#33

Version:6.x-2.0-alpha3» 6.x-3.0-alpha2
Status:postponed (maintainer needs more info)» fixed

Hi,

The arguments work very well in Panels 6.x-3.0-alpha2, not the contexts, but we can now have a working panel which takes a TID argument (or any argument I guess). See #385638: context does not get passed to views pane

As Panels2 will never get out of alpha, I'm upgrading the version of the issue to 6.x-3.0-alpha2 and marking it as fixed. I hope you Panel devs don't mind if I took the liberty to triage these bugs, and that I did nothing wrong :)

#34

Hi,

Panels 3 is the way to go! But for people on Panels 2 with access problems this post is may be handy: http://drupal.org/node/386774#comment-1302660

Greetings,
Martijn
www.trekking-world.com

#35

Status:fixed» closed (fixed)

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

#36

I am getting this error without Panels installed at all on Acquia Drupal 6.9. So far I have only seen it under Comment Notify

#37

I'm trying to override some pages of taxonomy terms but there was no success. I'm using Pathauto and it turned the path of taxonomy to category/%term. Will somebody write a step by step for doing this? (I'm using RC release.)

#38

Panels doesn't see pathauto's changes.

Let's say you have a term with the TID of 1 an that term is apple and pathauto changes the path to categories/fruit/apple -- Drupal and Panels will still see that path as taxonomy/term/1.

Therefore, setting your stuff on the taxonomy term page should still work normally, whatever pathauto says it should be.