Dear all

I am using the latest acidfree and OG module versions when i try to create a Acidfree album in a group I get warnings..

* warning: array_keys() [function.array-keys]: The first argument should be an array in modules/acidfree/acidfree.module on line 2024.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in modules/acidfree/acidfree.module on line 2024.

CommentFileSizeAuthor
#19 array_warnings.patch.txt777 bytesvhmauery
#9 acidfree_1.patch449 bytesxtony
#8 acidfree_0.patch571 bytesxtony

Comments

vhmauery’s picture

It looks like $acidfree_types is not set correctly. Are you sure you installed acidfree correctly? What does acidfree/test look like?

Andrupal’s picture

I'm having the same issue except at different line numbers. Perhaps we are running different cvs versions...?

* warning: array_keys() [function.array-keys]: The first argument should be an array in /modules/acidfree/acidfree.module on line 2009.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /modules/acidfree/acidfree.module on line 2009.

When I run acidfree/test, I see no problems.

vhmauery’s picture

Try installing the latest version of acidfree (currently 1.62.2.25) and see if it goes any different. It is possible that somehow the wrong value of acidfree_types got stored in your database. It is cached for performance reasons.

To fix this, you might try the sql query:

DELETE FROM variable WHERE name='acidfree_types';

and then simply hitting submit on the admin/modules page to flush the menu cache.

Andrupal’s picture

I've uploaded v 1.62.2.27, dropped all acidfree tables, system table entry, and variable entries, and allowed the module to reinstall all databases entries. The problem remains.

gmak’s picture

I am getting the same behaviour with module version 1.62.2.29 and CVS versions. I do not OG installed.

I've tried deleting the entry from the variable table. Problem persists.

I've tried removing all references to Acidfree from the database (all tables and all modifications to other tables). Problem persists.

the warning is:

warning: array_keys(): The first argument should be an array in /home/httpd/vhosts/maadlab.com/httpdocs/modules/acidfree/acidfree.module on line 1966.

beakertrail’s picture

Priority: Normal » Critical

Same problem as the last description. On all Acidfree pages I get warning: array_keys(): The first argument should be an array in /usr/local/psa/home/vhosts/website/httpdocs/modules/acidfree/acidfree.module on line 1966.

I do not have any of the image manipulation tools installed but the acidfree test page shows no error.

This is the most current version as of today with the most recent drupal release.

Also, when adding an image the image add page goes blank after submitting and the image does not get added.

markcaldwell’s picture

I'm having exactly the same problem on a new installation of Drupal. I added the filemanager from CVS then Acidfree before getting the array_keys() error on line 1966.

Drupal 4.7.2 (http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.2.tar.gz)
Acidfree 4.7.0 (http://ftp.osuosl.org/pub/drupal/files/projects/acidfree-4.7.0.tar.gz)
Filemanager CVS (http://ftp.osuosl.org/pub/drupal/files/projects/filemanager-cvs.tar.gz)

The Acid free test page comes back with:

  1. Filemanager module enabled
  2. Latest version of Filemanager module installed
  3. filemanager-private.patch applied
  4. Filemanager private path set and permissions OK
  5. Filemanager public path set and permissions OK
  6. Filemanager database table created
  7. Acidfree class definition files found for album, photo, video
  8. Drupal 'Temporary directory' path set and permissions OK
  9. Acidfree database tables created
  10. gd image toolkit installed and properly configured

No errors were detected. But this doesn't mean that Acidfree is guaranteed to work flawlessly. It is a complex system and still under development. Please be patient while all the wrinkles are found and ironed out.

I've tried DELETE FROM variable WHERE name='acidfree_types'; but that hasn't worked. I've also tried removing both modules and adding them back in again too.

xtony’s picture

StatusFileSize
new571 bytes

Hello guys,

Firstly, i don't know much about this module. just started using it.

i think 'acidfree_make_breadcrumbs' shouldn't be called by 'acidfree_form' (acidfree.module 1035-1036) because node information passes to 'acidfree_form' does not match the one which '_acidfree_get_parent' wants. lets drupal do this job.

Any idea?

xtony’s picture

StatusFileSize
new449 bytes

Hello,

follow up my post, 'acidfree_form' still have to call 'acidfree_make_breadcrumbs'. Sorry for the mistake :)
I have placed a condition check for node information which compatible with '_acidfree_get_parent'.

Please review my patch again.

vhmauery’s picture

Priority: Critical » Normal

There are two different array_keys problems here. I fixed one of them in CVS.

The original problem, related to OG, I am not sure what is going on. The problem seems to be that $acidfree_types is not getting set correctly and it not an array in the function _acidfree_get_class_from_path, which gets called to determine which acidfree type to create. What is the path you are using to add a new item with OG?

xtony’s picture

Hello vhmauery,

are these problems caused by OG? I never use the OG module, so i don't know what the problems are.
Can you tell me more about this bug? perhaps i could help.

vhmauery’s picture

OG has been a thorn in my side ever since I released Acidfree. The two just don't play well together. I am half tempted to say Acidfree is not supported with OG and close all the OG related bugs. Maybe even go as far as adding horrible warning messages to the acidfree init stuff that checks to see if OG is installed.

I am not sure why the problem exists, but evidently trying to add an album to an OG group causes problems. The thing I would like to know is what is the drupal path when you try to do this. Normally, adding an album looks like node/add/acidfree/album and possibly has a /number suffix to say which album to add it to. The thing I am worried about is that maybe OG is doing something funky that calls this page indirectly or from a different path and it messes things up for acidfree.

xtony’s picture

node/add/acidfree is the path for adding album
node/add/acidfree/photo,video,mass is for the rest.

when did you patch the first problem? did you use my patch?

I don't know what happen here. but i just removed my patch from the module and only the patch from http://drupal.org/node/73349 left. the warning message should be up. but there is no problem at all.

then i copied the original acidfree.module and class_video.inc files from my backup to the module.
now the warning message is back. even when applied the http://drupal.org/node/73349 patch.

Maybe i'm too sleepy to do thing now.

beakertrail’s picture

Title: acidfree along with OG module creating warnings » Same problem without OG

What the issue:
warning: array_keys(): The first argument should be an array in /home/httpd/vhosts/maadlab.com/httpdocs/modules/acidfree/acidfree.module on line 1966.

I get this with CVS and 4.7
I dont have OG installed.

vhmauery’s picture

Title: Same problem without OG » acidfree along with OG module creating warnings

Beakertrail,

You need to get the latest version of Acidfree. Previous comments in this bug say two things: A) what you are seeing is already fixed and B) what you are seeing is a different problem than the OG warnings.

ysanchez’s picture

I have the same problem. I downloaded the latest version of Filemanager (cvs) and Acidfree (4.7) today. It's a fresh install. I don't use OG module. The Acidreefree test page report no errors. Here is the error message I have:

warning: array_keys() [function.array-keys]: The first argument should be an array in /www/html/drupal/sites/asclub.unige.ch/modules/acidfree/acidfree.module on line 2144.
warning: in_array() [function.in-array]: Wrong datatype for second argument in /www/html/drupal/sites/asclub.unige.ch/modules/acidfree/acidfree.module on line 2144.
warning: array_keys() [function.array-keys]: The first argument should be an array in /www/html/drupal/sites/asclub.unige.ch/modules/acidfree/acidfree.module on line 2151.
warning: in_array() [function.in-array]: Wrong datatype for second argument in /www/html/drupal/sites/asclub.unige.ch/modules/acidfree/acidfree.module on line 2151.

Tx

vhmauery’s picture

Status: Active » Fixed

All y'all should try the latest acidfree to see if it is fixed. I changed the way acidfree_types gets set up in revision 1.62.2.44. I am pretty sure this is fixed. If you are still getting these errors, reset the status to active.

Obi-Wan@hispa-net.com’s picture

Status: Fixed » Active

Hi.

Acidfree still shows this errors when i am working with albums

warning: in_array(): Wrong datatype for second argument in /home/hispa-net/drupal/public_html/modules/acidfree/acidfree.module on line 2018.
warning: in_array(): Wrong datatype for second argument in /home/hispa-net/drupal/public_html/modules/acidfree/acidfree.module on line 2018.

The test doesn't show any problem. I am using drupal 4.7.3, acidfree 4.7.0 and Filemanager CVS module. I don't use the OG module.

vhmauery’s picture

StatusFileSize
new777 bytes

Obi-Wan, try this patch and see if it helps.

vhmauery’s picture

Status: Active » Needs review
Obi-Wan@hispa-net.com’s picture

By the moment that patch fixed all warnings.

Thanks.

vhmauery’s picture

Status: Needs review » Fixed

okay, I committed the patch. It is fixed in revision 1.62.2.49. It should be repackaged and available within 12 hours or so.

vhmauery’s picture

Status: Fixed » Closed (fixed)