I couldn't get drush generate neither the schema file nor install file, so I copied the autoadmin_simpletest module and customized the files.

I didn't set a relations array, just needed a simple table. So with no relations array being set, I tried to install the module and got the message:

Type of [relations] must be of type array

On Modules page, it shows that it's installed but couln't get it work.

Comments

_rune’s picture

Status: Active » Postponed (maintainer needs more info)

Hi

Thx for using Auto Admin. Could you attach a mysql dump of the table and your "[MODULE].autoadmin.inc" file?

Auto Admin should be okay with not having a setting for relation. If that is not the case I will fix it. Fast workaround is:

  ...
  'relations' => array(),
  ...

in "[MODULE].autoadmin.inc".

Take care
Rune

XaraX’s picture

Hi Rune,

Setting an empty relations array did not work, I still get the same error:

Module=autoadmin_phone_book,Table=autoadmin_phone_book: Type of [relations] must be of type array.

Please see attached files for mysql dump of the table and the "[MODULE].autoadmin.inc" file.

Thank you

_rune’s picture

StatusFileSize
new28.76 KB

Hi

Wauw, I really did have a bug regarding validate of the schema. I have attached a .tar.gz file with a new version of autoadmin and a version of the phone_book module. Please notice that I've created a department table that has a one_to_many relation to the phone_book table as well. If you could please test on your setup I will create a new release and add some unit tests for the validation function.

Cheers
Rune

P.S.: Am wondering why the drush command did not work. It worked fine for me. Here is what I did (on a fresh drupal install):

drush dl autoadmin schema module_builder
drush en autoadmin schema module_builder
drush mb phone_book menu --write
drush en phone_book
drush autoadmin generate phone_book phone_book department --write

Maybe you did not enable the phone_book module before running "autoadmin generate"?

XaraX’s picture

I'm going to try the files you've attached tomorrow on the production server and let you know about it.

The missing piece about my drush generation is the "module_builder" module. I didn't install it because it's not mentioned in Quickstart, Prerequisites and documentation. It'ld be better to update these documents.

Thanks Rune

_rune’s picture

Well "module_builder" is not a requirement, but there should be a valid module (.info and .module) file, and the module should be enabled. I will update the appropriate docs immediately. Thx for pointing this out!

EDIT: Updated the "Getting started" section on the "Using Auto Admin from the command line" handbook page and the "Quickstart" section on the project page. Again, thx!

XaraX’s picture

Status: Postponed (maintainer needs more info) » Fixed

Rune,

I've tried the module you've attached. Setting an empty "relations" array works fine now.

One more thing before releasing a new update:

Call time pass reference usage is deprecated, it'ld be better to fix wherever it's used. If you don't set "allow_call_time_pass_reference" to "off" on php.ini, the autoadmin module generates warnings on listing and editing pages:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file....

Thanks a lot!

_rune’s picture

Hi XaraX

Good to hear.

About the calling of functions like foo(&$bar), it is a copy / paste error I do sometimes. Pasting the function definition and forgetting to remove the "&". Weird I did not see the error messages as I test with "E_ALL|E_STRICT". Will hunt them down before the new release. Thx for catching them!

Have a splendid day.
Rune

Status: Fixed » Closed (fixed)

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