Entered data is processed malformed and not being saved

asb - March 30, 2008 - 19:15
Project:Taxonomy Fields
Version:5.x-1.7-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Hi,

I'm currently evaluating the "Taxonomy Fields" module for a certain task. In this installation, entered data is being processed malformed an not being saved. Error message given:

warning: preg_match() expects parameter 2 to be string, array given in /var/www/drupal/modules/date/date.inc on line 1602.
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/drupal/includes/database.mysql.inc on line 400.

Steps to reproduce:

* Field type: date
* Granularity: Year, Month - or - Year, Month, Date

Whatever date you try to enter, the data will never be saved, and the above error will alway appear.

Greetings, -asb

#1

boneless - March 30, 2008 - 23:49
Status:active» postponed (maintainer needs more info)

Hi,
I had a look and it seems to work fine for me.
Which version of 'date' are you using?
What is your input format?

#2

asb - March 31, 2008 - 11:45

Hi boneless,

I'm using Date 5.x-1.8. admin/settings/date-time is configured to

* Short: 31 Mär 2008 - 12:31
* Medium: 31. März 2008 - 12:31
* Long: Montag, 31. März 2008 - 12:31

The created taxonomy field in admin/content/taxonomy_fields is formatted:

* Select List - or - Text Field (same error); when "Select list":
** Input format: Site default
** Select list: Year, Month, Date
** Granularity: Year, Month, Date
** Default Display: 31. März 2008 - 12:31
** Time zone handling: No time zone conversion

Display settings:
* Label: Inline
* Teaser: Standard - or- As Time Ago (same error, no matter what is configured here)
* Full: Standard

Have I missed something? Is there something else to sonsider?

Thank you for the quick reply!
-asb

#3

boneless - March 31, 2008 - 12:47

hey,
I used exactly the same settings described above as well as the German translation and it does the trick here.
Can you please try and just use ONLY CCK, taxonomy fields and date on a clean Drupal 5.7 install?
I am pretty sure it must be something with another module or a setting, perhaps a server setting?
Does the error appear if date is used in a normal content type?
You can also send me an email on my contact form.

#4

asb - March 31, 2008 - 14:30

Hi,

the concept of Taxonomy Fields is such an great idea, and I'm still stunned by the sheer amount of possibilities it provides. However, there seem to be serious glitches in the modules stability. Most of what I try to accomplish, Taxonomy Fields won't let me do it. The above example was supposed to become a publishing date, attached to a term for a media typ (like a book or a magazine) which have a release date; that gave the above error.

Now I've tried to add some data to zoological terms in a vocabulary targeted to describe species. The vocabulary allows to select different species, and I'd like to add CCK fields which describe the species in more detail without creating a new content type. That's where Taxonomy Fields module should jump in; I'd like to add stuff like height, weight, etc. to certain term.

Again, Taxonomy Fields can be attached to terms of the vocabulary; however, most of the stuff I'm entering is *not* being saved. Example:

* Field: field_widerristhhe_rde (German umlauts seem to be automatically removed)
* Label: "Widerristhöhe ♀"
* Widget: Select list

* Text processing: Plain text
* Maximum length: 25

Allowed values list:

unter 5 cm
10 cm (± 5 cm)
15 cm (± 5 cm)
20 cm (± 5 cm)
25 cm (± 5 cm)
30 cm (± 5 cm)
35 cm (± 5 cm)
40 cm (± 5 cm)
45 cm (± 5 cm)
50 cm (± 5 cm)
55 cm (± 5 cm)
60 cm (± 5 cm)
65 cm (± 5 cm)
70 cm (± 5 cm)
75 cm (± 5 cm)
80 cm (± 5 cm)
85 cm (± 5 cm)
90 cm (± 5 cm)
über 95 cm (± 5 cm)

Display settings:

* Typ: Text
* Label: Inline
* Teaser: Default
* Full: Default

In edit view, the widget appears as wanted; if a choose a value, e.g. "55 cm (± 5 cm)", and save the node, nothing is displayed, neither in teaser view, nor in full view; if I edit the node again, the fields are empty. This I can repeat several times - the "Taxonomy Fields" modules always "forgets" the entered data.

On the other hand, I was able to create at least *one* Taxonomy Field (integer) where data is memorized and displayed by the module, so basically it seems to work.

Greetings, -asb

#5

boneless - April 1, 2008 - 18:12

again, the given example works fine for me.
my guess: your are using the wrong field type.
are you using a 'integer' or 'decimal' field instead of a 'text' field? they will never save a value like '70 cm (± 5 cm)' as it is a text and not a number! please check your field type.
regarding the 'date' field i tried quite a few possibilities, it works fine for me. i can't do much more if i don't have more information.
have you tried ONLY CCK, taxonomy fields and date on a clean Drupal 5.7?

#6

asb - April 1, 2008 - 22:26

Hi,

> my guess: your are using the wrong field type.
> are you using a 'integer' or 'decimal' field instead of a 'text' field? they will never save a value like '70 cm (± 5 cm)' as it is a text
> and not a number! please check your field type.

From admin/content/taxonomy_fields:

Display settings Terms settings Widerristhöhe ♂ field_widerristhhe_rde text options_select 0 Bearbeiten remove
Widerristhöhe ♀ field_widerristhhe text options_select 0 Bearbeiten remove
...
Erscheinungsdatum field_erscheinungsdatum date date_text 0 Bearbeiten remove

If I edit a node with an attached date_text Taxonomy field, now I get this error:

warning: preg_match() expects parameter 2 to be string, array given in /var/www/drupal/modules/date/date.inc on line 1602.
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/drupal/includes/database.mysql.inc on line 400.
user warning: Duplicate entry '0' for key 1 query: INSERT INTO content_field_erscheinungsdatum (field_erscheinungsdatum_value, vid, nid) VALUES ('', 0, 0) in /var/www/drupal/includes/database.mysql.inc on line 172.

> have you tried ONLY CCK, taxonomy fields and date on a clean Drupal 5.7?

No, sorry, I don't have such an installation on hand. But I tested Taxonomy Fields on different and separate Drupal installations, with similar results.

Is there anything else I could check?

Thanks & greetings, -asb

 
 

Drupal is a registered trademark of Dries Buytaert.