Error after adding existing list

Clemens - March 21, 2007 - 12:42
Project:Mailman Manager
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:arturoramos
Status:closed
Description

At URL: /admin/settings/mailman_manager/add
Click on 'Add'
Results in: Fatal error: Cannot use object of type stdClass as array in /var/www/drupal/includes/theme.inc on line 780
Using theme: Garland

List is actually added and visible in the list overview at URL: /user/1/edit/mailman_manager

Thank you for a great module...

#1

Clemens - March 21, 2007 - 13:32

Same error when entering /admin/settings/mailman_manager from 'Administer'

But I can continue adding (existing) lists via: /admin/settings/mailman_manager/add

#2

arturoramos - March 29, 2007 - 22:57
Assigned to:Anonymous» arturoramos
Status:active» postponed (maintainer needs more info)

I do not understand your issue correctly... when you say that this error is being generated when adding an EXISTING list, what exactly does that mean?

I am unable to replicate your error. I am able to add lists from the admin/settings/mailman_manager without any errors.

What do you mean by "existing" lists?

#3

drdrup - April 29, 2007 - 07:25

I get exactly the same error.
[I assume that when Clemens talked about "EXISTING list", it is probably a list that was already set up in mailman, and Clemens was just trying to add it in Drupal; but I think that it dos not matter, as Drupal does not try to interact with mailman yet]

Here are the steps that I did so far:
1) Installed mailman_manager-5.x-1.x-dev (20070319)
2) Enabled the module in the ".../modules" page.
3) The "Mailing Lists" of this module appeared in the list in ".../admin" as expected.
4) I went to ".../admin/settings/mailman_manager"; the page appeared probably as expected (I don't have anything to compare it with, but it looks reasonable). It has

"Mailing Lists"
"Name" "Request address"
"Add new mailing list"

5) I press "Add new mailing list" and it goes to page ".../admin/settings/mailman_manager/add"
6) I add the information for a mailman list, and press the "add" button
7) It goes to a page ".../admin/settings/mailman_manager" but it is EMPTY!
8) Checking the website error_log, there is an entry:

PHP Fatal error: Cannot use object of type stdClass as array in .../includes/theme.inc on line 780, referer: http://.../admin/settings/mailman_manager/add

9) It looks like nothing happened, but I checked the mySQL database, and there is an entry in the "mailman_lists" table which looks OK.
10) If I go back to the ".../admin" page, and press the "Mailing Lists", it goes to ".../admin/settings/mailman_manager" but the page is EMPTY as well. (and don't have an opportunity to add any additional list, as the page is empty now).
The corresponding error in error_log is:

PHP Fatal error: Cannot use object of type stdClass as array in .../includes/theme.inc on line 780, referer: http://.../admin

11) Interesting, but if I go to ".../user/1/edit/mailman_manager", the newly-added mailman list DOES appear there and it looks OK (I haven't tried yet to subscribe to it via Drupal).
12) So the problem may be only in the admin portion.

PS: I did try to delete the entry from the mailman_list table in mySQL. When I do that, the ".../admin/settings/mailman_manager" page become accessible again, as in step (4), and I have the opportunity to continue to (5) etc, and all the problems repeate as described above.
[I am using Drupal 5.1]

#4

toasterz - May 3, 2007 - 05:58

I see the same error after adding a list using the mailman admin page.

I have cac_lite installed, but cannot configure with a similar error. maybe look to cac_lite unresolved issue.

1) add a list using a properly rendered module page.
2) click submit
3) receive error
4) check to see if the list was created, yes it is.
5) mailman subscribe command works using mailing lists menu item.
6) subsequent attempts to administer or add a new list receive same error message.

#5

yopyop - May 24, 2007 - 21:30

I am also having this same error using Drupal 5.1 and the theme: spreadfirefox, using 5.x-1.x-dev

The only think I can do is add new: admin/settings/mailman_manager/add, and this generates the error:

Fatal error: Cannot use object of type stdClass as array in /home/.lytle/mylogin/mysite.org/includes/theme.inc on line 780

but, like the others here, it does create the mailing list - and it's possible to access it as a user, subscribe, etc - it seems to actually work

- but none of the admin functions/settings work except for 'add' - but this generates an error when adding.

Lovely module, hope to get it working..

#6

sniper08 - May 25, 2007 - 07:05

You may fix the problem by changing line 445 of mailman_manager.module to $lists[] = (array) $list;.

The reason is that theme_table takes an array as the second parameter. Line 442 of mailman_manager.module is while($list = db_fetch_object($result)) {, which makes $list an object.

Another fix would be to change the call to db_fetch_array and line 442/3.

#7

jp.stacey - May 29, 2007 - 13:25
Status:postponed (maintainer needs more info)» needs review

Thanks for weeding that out. I was just about to post a "me too" to this bug.

The former solution worked for me. Odd that some people just aren't seeing this problem. Differing PHP versions, perhaps?

Anyway, it's only a one-line change but please find attached a patch for review.

AttachmentSize
mailman_manager.module_1.patch 549 bytes

#8

rleigh - June 7, 2007 - 23:50

had same problem; this fix worked for me

#9

arturoramos - June 12, 2007 - 11:38
Status:needs review» closed

I have changed the call in line 445 to a fetch_array call.

I have also unset a number of the variables in the array so as to improve the list of lists display.

 
 

Drupal is a registered trademark of Dries Buytaert.