I am getting error when uploading file and using page-route module and node profile module.
image attached
cck latest
imagefield 2.1
drupal 5.7

Comments

farzan’s picture

Category: support » bug

I encounter errors as well:

<br />
<b>Fatal error</b>:  Cannot access empty property in <b>C:\xampp\htdocs\modules\imagefield\imagefield
.module</b> on line <b>1143</b><br />

I receive this DB error as well, I cannot tell exactly when i receive it:

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 C:\xampp\htdocs\includes\database.mysql.inc on line 172.

If you note, in the query name of the content table is missing: "FROM content_ WHERE...".
If i try to add images out of pageroute, everything is fine.

farzan’s picture

I checked the code and inspected function imagefield_js() in imagefield.module. here i copy the dump of $_POST in two sessions; first when everything is fine:

Array
(
    [title] => a
    [nid] => 48
    [field_photo] => Array
        (
            [0] => Array
                (
                    [alt] => Winter.jpg
                    [title] => 
                )

        )

    [cck_imagefield_field_photo_op] => Upload
    [vid] => 48
    [type] => dummy
    [changed] => 1213863660
    [body] => 
    [format] => 1
    [form_token] => 8755d696380e650dd05043bd9a32a81f
    [form_id] => dummy_node_form
    [field_photo-attach-url] => http://localhost/imagefield/js
    [log] => 
    [menu] => Array
        (
            [title] => 
            [description] => 
            [pid] => 1
            [path] => 
            [weight] => 0
            [mid] => 0
            [type] => 86
        )

    [comment] => 0
    [pathauto_perform_alias] => 1
    [name] => admin
    [date] => 2008-06-19 08:21:00 +0000
    [status] => 1
)

and this one is the dump when error raises:

Array
(
    [profile_personal_node_form] => Array
        (
            [nid] => 40
            [field_first_name] => Array
                (
                    [0] => Array
                        (
                            [value] => fn
                        )

                )

            [vid] => 40
            [type] => profile_personal
            [changed] => 1213863192
            [field_image-attach-url] => http://localhost/imagefield/js
            [field_last_name] => Array
                (
                    [0] => Array
                        (
                            [value] => ln
                        )

                )

            [field_image] => Array
                (
                    [0] => Array
                        (
                            [alt] => sdfs
                            [title] => fsdf
                        )

                )

            [cck_imagefield_field_image_op] => Upload
            [log] => 
            [menu] => Array
                (
                    [title] => 
                    [description] => 
                    [pid] => 1
                    [path] => 
                    [weight] => 0
                    [mid] => 0
                    [type] => 86
                )

            [path] => profile/lnfn
            [comment] => 2
            [name] => admin
            [date] => 2008-06-17 07:18:49 +0000
            [status] => 1
        )

    [files] => Array
        (
            [field_image_upload] => Winter.jpg
        )

    [form_token] => cef54dde8585627e9b63b5a3a4def14d
    [form_id] => pageroute_page_input_personal_form
)

Note these two dumps belong to two different content types, but one thing is obvious: when you use the imagefield in a pageroute, the image info array is inside another array, like this one: "profile_personal_node_form".

Since I am not familiar with this module, I cannot contribute a patch for it; however I think I can solve my own problem :)

quicksketch’s picture

Status: Active » Closed (won't fix)

I'm closing this issue since it is over a half-year old without updates. This problem wouldn't be handled in ImageField anyway, please take it up with the author of Page-route or Nodeprofile.