Hi, I'm not sure if this is a bug, I created a pageroute with two pages. First page is to add a node with title, description, and a cck field to upload a file (using the filefield module), The second page is just a "Thank You Page" using display node.

Everything works fine if I don't upload a file, but if I do, I get this error:

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 'FROM content_ WHERE vid = 0 LIMIT 0, 1' at line 1 query: SELECT FROM content_ WHERE vid = 0 LIMIT 0, 1 in /home/idesanta/domains/idesanta.gob.mx/public_html/includes/database.mysql.inc on line 172.

I've tried using the "Create Content", without using the pageroute, and I CAN upload files and get no error, but I need the Thank You Page after submitting a new node.

Is this a bug or am I missing something here?

Thanks in advance

Luis

Comments

BrandTim’s picture

I have encountered this problem too.

I can confirm that it is a problem with pageroute conflicting with filefield because when I use the same form outside of the pageroute the error does not appear.

BrandTim

BrandTim’s picture

More information:

This is caused by the presence of the '#pre_render' array in the $form data. I was able to get a file to upload properly by removing it (via a custom hook_form_alter). I cannot find mention of this form property in the APIs, so I'm at a loss as to its purpose and any results its removal might have.

Note that this is a slightly overlapping issue with the bug mentioned here:
http://drupal.org/node/239727#comment-802671

In addition to removing the #pre_render array, johanneshahn's bugfix also needs to be applied in order for this fix to work.

BrandTim

Tauran’s picture

Status: Active » Closed (fixed)

Please reopen if request persists.

paul_gregory’s picture

Status: Closed (fixed) » Fixed

I was experiencing the same issue when using Filefield 5.x-2.3 and Pageroute 5.x-1.0. My problem cleared up when I upgraded Pageroute to 5.x-1.1.

This has been bugging me on and off for months! I'm happy now.

Status: Fixed » Closed (fixed)

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