autonode: parse_url() expects parameter 1 to be string, array given in

kenorb - March 15, 2008 - 11:37
Project:Autonode CCK widget
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

If you have db_url variable in settings.php as an associative array, you have following errors:

    * warning: parse_url() expects parameter 1 to be string, array given in C:\Users\bronek\workspace\ICLP\vivid-intel-flex\trunk\webapp\intel_flex\sites\all\modules\contributions\autonode\autonode.module on line 389.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: _get_columns SHOW COLUMNS FROM in C:\Users\bronek\workspace\ICLP\vivid-intel-flex\trunk\webapp\intel_flex\includes\database.mysql.inc on line 172.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE field=''' at line 1 query: autonode_field_settings SHOW COLUMNS FROM WHERE field='' in C:\Users\bronek\workspace\ICLP\vivid-intel-flex\trunk\webapp\intel_flex\includes\database.mysql.inc on line 172.
    * warning: parse_url() expects parameter 1 to be string, array given in C:\Users\bronek\workspace\ICLP\vivid-intel-flex\trunk\webapp\intel_flex\sites\all\modules\contributions\autonode\autonode.module on line 389.
    * warning: parse_url() expects parameter 1 to be string, array given in C:\Users\bronek\workspace\ICLP\vivid-intel-flex\trunk\webapp\intel_flex\sites\all\modules\contributions\autonode\autonode.module on line 389.

In settings.php you can read followed text:

* To specify multiple connections to be used in your site (i.e. for
* complex custom modules) you can also specify an associative array
* of $db_url variables with the 'default' element used until otherwise
* requested.

Patch for this bug in attachment.

AttachmentSize
autonode.module.patch452 bytes

#1

snufkin - March 16, 2008 - 17:53
Status:patch (to be ported)» reviewed & tested by the community

thanks for the patch, I will commit it as soon i can get to cvs close.

#2

snufkin - March 17, 2008 - 10:03
Status:reviewed & tested by the community» fixed

patch committed.

#3

Anonymous (not verified) - March 31, 2008 - 10:12
Status:fixed» closed

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

#4

msjones design - September 2, 2008 - 22:45

I recently uploaded your module and I am still getting this error. Question, will module automatically create nodes with populated tables or do I have to run cron jobs or something. Sorry not a programmer, a designer but I'm learning.

#5

snufkin - September 3, 2008 - 20:13
Status:closed» active

Could you paste the exact error message you're getting?

To answer your question: it should automatically create the node when you submit a not-yet existing reference.

#6

msjones design - September 4, 2008 - 15:56
Title:parse_url() expects parameter 1 to be string, array given in» errors and morehelp getting started!!
Category:bug report» support request

My client wants to download a Vendor account information database (including long/lang and keywords eventually) into the Drupal database and have Drupal automatically create nodes where we will then create a searchable database for businesses using a mix of other fun modules. Every once in awhile client would like to update listings the same way (can we avoid duplicates)

Thank you for your assistance or reality check:

First field set up I get:

* warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/zebra.msjones.com/httpdocs/includes/bootstrap.inc on line 670.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/zebra.msjones.com/httpdocs/includes/bootstrap.inc on line 670.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/zebra.msjones.com/httpdocs/includes/bootstrap.inc on line 670.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/zebra.msjones.com/httpdocs/includes/bootstrap.inc on line 670.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/zebra.msjones.com/httpdocs/includes/bootstrap.inc on line 670.

#7

snufkin - September 5, 2008 - 14:40
Title:errors and morehelp getting started!!» errors on field setup

So you get this error the very first time you click save field? Unfortunately this error is pretty obscure. Could you give me a sample data i could test with? Are there other modules that can affect the creation of the "business nodes"?

#8

csc4 - July 13, 2009 - 17:06

I have a theory - I think it is if you set the field to use existing node type and not a table it causes a problem in

function autonode_field_settings($op, $field) {
  switch ($op) {
  case 'database columns':
    $columns = array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => '0',
),
);
/* We try to store the given keys as well, for this
* a check is done what type the reference key column has
*/
if(isset($field['ref_field'])) {
$ref_table = _get_table_list();
$ref_table = $ref_table[$field['ref_table']];

$ref_col = _get_columns($ref_table);
$ref_col = $ref_col[$field['ref_field']];

$database_type = db_fetch_array(db_query("SHOW COLUMNS FROM %s WHERE field='%s'", $ref_table, $ref_col)); // no prefix {}, $ref_table has the prefix already
$pattern = '/[0-9]{1,}/';
preg_match($pattern, $database_type['Type'], $length);
$type = str_replace('('.$length[0].')', '', $database_type['Type']);

A D6 version would also be very lovely

#9

kenorb - July 13, 2009 - 17:54
Category:support request» bug report
Status:active» fixed

This thread was related to:

* warning: parse_url() expects parameter 1 to be string, array given in autonode\autonode.module on line 389

not in bootstrap.inc on line 670.
Where there is no proof that it's related to autonode module.

Reported issue has been fixed in #2 one year ago.

Please look for other issues:
http://www.google.co.uk/search?q=site:drupal.org/node+%22bootstrap.inc+o...
or create new support ticket.

#10

kenorb - July 13, 2009 - 17:54
Title:errors on field setup» autonode: parse_url() expects parameter 1 to be string, array given in

#11

csc4 - July 13, 2009 - 23:36

I was responding to http://drupal.org/node/234530#comment-994401 which is definitely about the preg_match error which is related to autonode as it only happens when the new version (ie the non airport codes version) is installed.

#12

kenorb - July 14, 2009 - 09:54

msjones design says:
"I recently uploaded your module and I am still getting this error"...
#6:
warning: preg_match() expects parameter 2 to be string
is not the same as:
#0 warning: parse_url() expects parameter 1 to be string
It's different error, so solution should be different as well.
So changing the patch in #0 nothing will help in this situation.
Patch was working and has been reviewed and tested and commited.

msjones design: please review how this issue is related to each other and eventually create new issue if you still have this problem.

#13

snufkin - July 14, 2009 - 10:15

Since that issue was posted last September and she hasnt provided any means of reproducing the error, so I dont think we can do anything about it.

#14

System Message - July 28, 2009 - 10:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.