FAQ
Short version: Catalyst/Formbuilder uploads work fine in firefox and chrome,
works fine in IE 6... but not IE 8, where it throws an "object expected"
error.

Long version:

We've got a weird situation -- Catalyst and FormBuilder work together to
generate HTML for a form including file uploads -- which work fine for older
Internet Explorers, but when attempting the POST using Explorer 8, instead
of an upload we get the error "Object Expected line 215 char 1". If we opt
not to upload anything, the rest of the fields in the form get posted just
fine.

Line 215 is:

<form action="/incident/2129" enctype="multipart/form-data" id="incident"
method="post" name="incident" onsubmit="return validate_incident(this);"><
input id="_submitted_incident" name="_submitted_incident" type="hidden"
value="1" />

The only thing there that looks like a suspect would be onsubmit="return
validate_incident(this)", right?

If you've run across this and know how to straighten it out, that
information would be very much appreciated.

In particular... Is there a way to fix this with a configuration arg to
Catalyst (v5.80027) or to FormBuilder (v3.0501)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101005/dc0a327b/attachment.htm

Search Discussions

  • Toby Corkindale at Oct 6, 2010 at 6:13 am

    On 06/10/10 14:00, will trillich wrote:
    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an "object
    expected" error.
    Ugh, I hit this a little while ago, but have forgotten the details already.
    I think you are looking in the right direction with the "this" though;
    try validating it in your function to ensure it contains what you're
    expecting perhaps?

    Also, can you verify that jquery is actually getting loaded OK?

    ie. In your document, put something like:
    $(function() { alert("jquery has loaded!"); });

    and check to see that you get an alert box when you load the page. If
    not, fire up Chrome's developer tools, or Firefox's Firebug, and see
    they mention any warnings or errors.

    -Toby
  • Will Trillich at Oct 6, 2010 at 1:27 pm
    The FormBuilder/Catalyst -generated HTML works just fine in Chrome and in
    Firefox, so debugging there isn't useful. It also works fine in older
    Internet Explorers. :( I was hoping someone has already run into this
    FormBuilder-snag-with-IE8 and found an elegant fix...

    And the "return validate_incident(this)" code is generated via FormBuilder,
    that's why I was asking the list, hoping someone else here has run into this
    and found a workaround.

    We do have other DHTML javascript on the page (e.g. click to dynamically add
    another upload-field) so Javascript and JQuery are working. IE8 has
    apparently been tweaked enough that it doesn't recognize the object in that
    context...?

    Any ideas?

    On Wed, Oct 6, 2010 at 1:13 AM, Toby Corkindale wrote:
    On 06/10/10 14:00, will trillich wrote:

    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an "object
    expected" error.
    Ugh, I hit this a little while ago, but have forgotten the details already.
    I think you are looking in the right direction with the "this" though; try
    validating it in your function to ensure it contains what you're expecting
    perhaps?

    Also, can you verify that jquery is actually getting loaded OK?

    ie. In your document, put something like:
    $(function() { alert("jquery has loaded!"); });

    and check to see that you get an alert box when you load the page. If not,
    fire up Chrome's developer tools, or Firefox's Firebug, and see they mention
    any warnings or errors.

    -Toby

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101006/4e822e41/attachment.htm
  • Moritz Onken at Oct 6, 2010 at 4:36 pm
    Sounds like a trailing comma in the javascript somewhere.


    Am 06.10.2010 um 15:27 schrieb will trillich:
    The FormBuilder/Catalyst -generated HTML works just fine in Chrome and in Firefox, so debugging there isn't useful. It also works fine in older Internet Explorers. :( I was hoping someone has already run into this FormBuilder-snag-with-IE8 and found an elegant fix...

    And the "return validate_incident(this)" code is generated via FormBuilder, that's why I was asking the list, hoping someone else here has run into this and found a workaround.

    We do have other DHTML javascript on the page (e.g. click to dynamically add another upload-field) so Javascript and JQuery are working. IE8 has apparently been tweaked enough that it doesn't recognize the object in that context...?

    Any ideas?


    On Wed, Oct 6, 2010 at 1:13 AM, Toby Corkindale wrote:
    On 06/10/10 14:00, will trillich wrote:
    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an "object
    expected" error.

    Ugh, I hit this a little while ago, but have forgotten the details already.
    I think you are looking in the right direction with the "this" though; try validating it in your function to ensure it contains what you're expecting perhaps?

    Also, can you verify that jquery is actually getting loaded OK?

    ie. In your document, put something like:
    $(function() { alert("jquery has loaded!"); });

    and check to see that you get an alert box when you load the page. If not, fire up Chrome's developer tools, or Firefox's Firebug, and see they mention any warnings or errors.

    -Toby

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Toby Corkindale at Oct 11, 2010 at 6:27 am

    On 07/10/10 03:36, Moritz Onken wrote:
    Sounds like a trailing comma in the javascript somewhere.
    The trailing-comma problem occurs in IE6/7, but not in IE8. (Thank you,
    Microsoft).
    I think Will's problem *doesn't* occur on IE6/7, but just IE8, if I
    understand the situation correctly:
    On 06/10/10 14:00, will trillich wrote:
    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an
    "object expected" error.

    I looked around our code a bit, and our own "object expected" errors
    here were being caused by some javascript assuming that a certain object
    would always have an object returned from a method, when in fact
    sometimes it didn't in older versions of IE :/
    Not so helpful for you, if this issue only appears on recent IE versions
    though.. confusing!


    Will, can you check to see if you're getting Internet Explorer 8 running
    in "IE8 standards mode", or if it's falling back to the older quirks
    mode or IE7 mode?

    Try this:

    alert("Document mode = " + document.documentMode);
  • Chris at Oct 11, 2010 at 10:27 pm

    On Mon, Oct 11, 2010 at 5:27 PM, Toby Corkindale wrote:
    On 07/10/10 03:36, Moritz Onken wrote:

    Sounds like a trailing comma in the javascript somewhere.
    The trailing-comma problem occurs in IE6/7, but not in IE8. (Thank you,
    Microsoft).
    I think Will's problem *doesn't* occur on IE6/7, but just IE8, if I
    understand the situation correctly:
    On 06/10/10 14:00, will trillich wrote:
    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an
    "object expected" error.
    Have you checked the JS in jslint.com? I've found it quite good at
    picking up syntax errors, and can reveal problematic code as well.

    - Chris
  • Will Trillich at Oct 25, 2010 at 4:19 pm
    Well this is just odd.

    When Firefox, Chrome and IE6 submit files-to-upload, the structure returned
    by $c->req->uploads is DIFFERENT for explorer -- it's an ARRAYREF instead of
    a HASHREF:

    DB<2> x $c->req->uploads
    *0 HASH(0x9d04d20)*
    '*newatt[1]*' => Catalyst::Request::Upload=HASH(0xb81a098)
    'filename' => 'japh.pl'
    'headers' => HTTP::Headers=HASH(0xb448c28)
    'content-disposition' => 'form-data; name="newatt[1]"; filename="
    japh.pl"'
    'content-type' => 'text/x-perl-script'
    'size' => 104
    'tempname' => '/tmp/6V0Vlas5td'
    'type' => 'text/x-perl-script'
    '*newatt[2]*' => Catalyst::Request::Upload=HASH(0xb448c88)
    'filename' => 'TODO'
    'headers' => HTTP::Headers=HASH(0xb650140)
    'content-disposition' => 'form-data; name="newatt[3]";
    filename="TODO"'
    'content-type' => 'application/octet-stream'
    'size' => 29
    'tempname' => '/tmp/2RTgotIgut'
    'type' => 'application/octet-stream'

    The same attempted upload for Explorer 8 looks like this instead:

    *0 ARRAY(0xab06360)*
    * 0* Catalyst::Request::Upload=HASH(0xb448c88)
    'filename' => 'japh.pl'
    'headers' => HTTP::Headers=HASH(0xb81a098)
    'content-disposition' => 'form-data; name="newatt[1]"; filename="
    japh.pl"'
    'content-type' => 'text/x-perl-script'
    'size' => 104
    'tempname' => '/tmp/3Tg94Iq85j'
    'type' => 'text/x-perl-script'
    *1* Catalyst::Request::Upload=HASH(0xb448c28)
    'filename' => 'TODO'
    'headers' => HTTP::Headers=HASH(0xb448c88)
    'content-disposition' => 'form-data; name="newatt[3]";
    filename="TODO"'
    'content-type' => 'application/octet-stream'
    'size' => 29
    'tempname' => '/tmp/T2r9F7Ex11'
    'type' => 'application/octet-stream'

    The structure of each node is the same, but as a whole the upload-list
    switches internally from a HASHREF to an ARRAYREF. IE6, FireFox, Chrome all
    bring in the Hashref, but IE8 brings in an Arrayref.

    On top of that, if there's just one upload, it's not even an array, it's
    just the node itself.

    What the heck? Sure seems odd to offer a different storage structure based
    on browser-platform...


    On Wed, Oct 6, 2010 at 8:27 AM, will trillich
    wrote:
    The FormBuilder/Catalyst -generated HTML works just fine in Chrome and in
    Firefox, so debugging there isn't useful. It also works fine in older
    Internet Explorers. :( I was hoping someone has already run into this
    FormBuilder-snag-with-IE8 and found an elegant fix...

    And the "return validate_incident(this)" code is generated via
    FormBuilder, that's why I was asking the list, hoping someone else here has
    run into this and found a workaround.

    We do have other DHTML javascript on the page (e.g. click to dynamically
    add another upload-field) so Javascript and JQuery are working. IE8 has
    apparently been tweaked enough that it doesn't recognize the object in that
    context...?

    Any ideas?


    On Wed, Oct 6, 2010 at 1:13 AM, Toby Corkindale <
    toby.corkindale@strategicdata.com.au> wrote:
    On 06/10/10 14:00, will trillich wrote:

    Short version: Catalyst/Formbuilder uploads work fine in firefox and
    chrome, works fine in IE 6... but not IE 8, where it throws an "object
    expected" error.
    Ugh, I hit this a little while ago, but have forgotten the details
    already.
    I think you are looking in the right direction with the "this" though; try
    validating it in your function to ensure it contains what you're expecting
    perhaps?

    Also, can you verify that jquery is actually getting loaded OK?

    ie. In your document, put something like:
    $(function() { alert("jquery has loaded!"); });

    and check to see that you get an alert box when you load the page. If not,
    fire up Chrome's developer tools, or Firefox's Firebug, and see they mention
    any warnings or errors.

    -Toby

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101025/3e23e1b6/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 6, '10 at 3:00a
activeOct 25, '10 at 4:19p
posts7
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase