The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

414 Request-URI Too Large

phayesphayes Member
in Bugs & Feature Requests edited April 2014
Hi there,

I have a form with lots of items and lots of properties (listed below). When I have less than 8 items everything works fine, but when I have more than 8 items I get the following error in the colorbox popup:
414 Request-URI Too Large

The request URL is over the maximum size allowed!
Powered By LiteSpeed Web Server
LiteSpeed Technologies is not responsible for administration and contents of this web site!

Note that if I submit the form in such a way that it does not get modified by foxycart JavaScript (but sends the user to the foxycart page without triggered the colorbox) then I don't get this error and it works. This is not a good solution for obvious usability reasons.

The forum software here won't let me paste the full HTML, but here's a sample to give you an idea.
<form action="https://highwire-drupal-testing.foxycart.com/cart"; method="post" accept-charset="utf-8">
<input type="submit" value="Add to Cart">
<input type="hidden" name="1:code" value="/ddfhs/36/4/525.atom||0925cee7d0557a383ffe80ed3050e9e4f314c4e650cfb2bedc568cf59ab95816">
<input type="hidden" name="1:name" value="Negotiating Kingship in France at the Time of the Early Crusades: Suger and the Gesta Ludovici Grossi||8aadb665c904d85bb30bcfd3313696c988322dec2809a0bc675bf624707f180d">
<input type="hidden" name="1:price" value="18.00||8ad091c77a3888a186c5345c0ab54c7ffcb51ee18090a659d98e86d8b58e09d2">
<input type="hidden" name="1:url" value="http://drupal-dev-phayes.highwire.org/content/negotiating-kingship-france-time-early-crusades-suger-and-gesta-ludovici-grossi||9226918e48bc6ca29c12b05e62187f2eb8d217764c76fe8710afbb00b0f9e86f">
<input type="hidden" name="1:quantity_max" value="1||246a23e0be54388f96aa13324ca36595a8005af9d272a8c96628ccae49c2c347">
<input type="hidden" name="1:for" value="article||43a9159493d0aa9bc0c9f2869314f1a7c9f96232868ff8cd38bb7f595fac4f40">
<input type="hidden" name="1:interval" value="34||ba42515045d7138a67a682b6a525aa6a8eebe32421826d80c61dd8a77c46773b">
<input type="hidden" name="1:image" value="http://drupal-dev-phayes.highwire.org/content/36/4.cover.gif||f126a0262b7b83be0b74d9dc3a99ff8d28101f4867f92cd6949ed72575966a95">
<input type="hidden" name="3:code" value="/ddfhs/36/4/571.atom||b894a24e869b3362f37de42da7f8989d8c3ddb49c1cd07a213fde40d2331dde8">
<input type="hidden" name="3:name" value="Bastardy, Race, and Law in the Eighteenth-Century French Atlantic: The Evidence of Litigation||3d18ff016ab9b3db2b77e17358a11b3cfab9819def61390b2cd705eda494681f">
<input type="hidden" name="3:price" value="18.00||14b08b3389ddf5e60198430403b0773bc404c46c7334978a4ad4cdd7726581b5">
<input type="hidden" name="3:url" value="http://drupal-dev-phayes.highwire.org/content/bastardy-race-and-law-eighteenth-century-french-atlantic-evidence-litigation||be88f7e6a65dd7c6c1d9d3a115ee203e1b5fca4c1755b34e87272688e88b2639">
<input type="hidden" name="3:quantity_max" value="1||cad99abe65df22cad6294b23cf66284265750484a17c52690994a3b55e3a4728">
<input type="hidden" name="3:for" value="article||e0089efc8a7cf278f36c2f70f1a0c9d69bf4a7c8e0e7341e1780ac54c0e112f2">
<input type="hidden" name="3:interval" value="34||2e0ee472c97bede54cc3942311e47e1104d04ee37be0db2326a6a1eac9edea0c">
<input type="hidden" name="3:image" value="http://drupal-dev-phayes.highwire.org/content/36/4.cover.gif||951a4c994ee7c4b5a491a5b5b15eaed1f5fa9c9f25ce35f5ec3741fbdaef9022">
<input type="hidden" name="2:code" value="/ddfhs/36/4/543.atom||0d31a4e92ae8bf2dfb65f8143500d37953930f9bdfd0616385c50c4b9acbb223">
<input type="hidden" name="2:name" value="An Unlikely Pair: Satire and Jansenism in the Sarcelades, 1731-1764||a8f5af2239b1c894d3bd825b815caa2026cdbef6e346c1e8f7c6f3da9de15217">
<input type="hidden" name="2:price" value="18.00||0f5e84607e87b7e23910fe0613bf8b3312ac63653d45e4bb08c0cc37c0c9141a">
<input type="hidden" name="2:url" value="http://drupal-dev-phayes.highwire.org/content/unlikely-pair-satire-and-jansenism-sarcelades-1731-1764||9414a4441ef2217cf71e9e6d002da0fad63d6d91cb9d5181673560af1d65c3b5">
<input type="hidden" name="2:quantity_max" value="1||80d8a34e82aa932257d46a3dac413f2f6a9f4f9c1a26e0aaccfcd961ef715d80">
<input type="hidden" name="2:for" value="article||02932dc9b5c366d69b00792087105fb3ddca17f169fd933c9cc2436d38b02eb1">
<input type="hidden" name="2:interval" value="34||a794b26fcfcd148d8eae7e25940c6375e20073a3833993dd162f471e4d2973e8">
<input type="hidden" name="2:image" value="http://drupal-dev-phayes.highwire.org/content/36/4.cover.gif||8163cf1018e2f5d8ffa362d7b46f1fb28770ce691b8718d116f16ce8c22e5f82">
<input type="hidden" name="4:code" value="/ddfhs/36/4/601.atom||23f51d84cbf13ee6125d167df6aaba803f9e8733a1f84fe01ab9545f766eae99">
<input type="hidden" name="4:name" value="“Celibacy Is a Social Crime”: The Politics of Clerical Marriage, 1793-1797||caa646e1b1fa1228693c6da1c8f3f0822ee07e974626fb26c90b0eaa46cc41b0">
<input type="hidden" name="4:price" value="18.00||b82e11600b68db6c6c5e3f774f666ab881061bcda2701973eacb3a710efd2b60">
<input type="hidden" name="4:url" value="http://drupal-dev-phayes.highwire.org/content/“celibacy-social-crime”-politics-clerical-marriage-1793-1797||98f3291c5c0bf894acc8f444db748419f03036c3b639a1802fb2b076cbc51ca0">
<input type="hidden" name="4:quantity_max" value="1||19ef7ae3dcb3c4c524a748ece06cdab22acd1d50c3f0d9fef46350619a9eb10b">
<input type="hidden" name="4:for" value="article||06442e62ca3bb07434a6fca834fd692469a1dbba2ae7b71091e2bbd8f098e0e7">
<input type="hidden" name="4:interval" value="34||0a66b6fbba110e603a82d53fc33049b3dba138b85d674e7a61dfc0bea1cbc551">
<input type="hidden" name="4:image" value="http://drupal-dev-phayes.highwire.org/content/36/4.cover.gif||a961f432363ee2a0cec70fb70a72941230e386748e910eee2d7a68b158159b87">
<input type="hidden" name="5:code" value="/ddfhs/36/4/629.atom||7e47fdf27ab2a4db58d8b182d879b5f61ef90129a172b47903ddf910529d3877">
<input type="hidden" name="5:name" value="“Un Nouveau ’93”: Discourses of Mimicry and Terror in the Paris Commune of 1871||786b3d6a62d33c186fe002b4c0553cb6dd4b62f3dd14c0a842e93577bb6435a9">
<input type="hidden" name="5:price" value="18.00||1c82fdc9184eddd0092297a5a33442e952712960ded18632b3b78ff8cdea71df">
<input type="hidden" name="5:url" value="http://drupal-dev-phayes.highwire.org/content/“un-nouveau-’93”-discourses-mimicry-and-terror-paris-commune-1871||9a750bb15bf0d40293aa4bb6e688bc2251e8ce57e8541f7d08a605755718e19f">
<input type="hidden" name="5:quantity_max" value="1||3735ad301a3f7f241e3898f9a6c4280faf79c73f54d38c0ed26d36885fa9a3ea">
<input type="hidden" name="5:for" value="article||877edd36703dc920b670edce3fd3ec25a896fb85c43541125bf88ec3da4d1f1c">
<input type="hidden" name="5:interval" value="34||6e542d5c0b3ff0b6d8bf2c979d32ba3682ca5b6d86fcce165a9b3692cf0bc97b">
<input type="hidden" name="5:image" value="http://drupal-dev-phayes.highwire.org/content/36/4.cover.gif||9167033e9c1c6b5127d9e8e316c808dba7ed2fcdfd4d5309a6ec4bafbf196617">
<input type="hidden" name="fcsid" value="2ihc6a7h2ok9e46nbt7olmh4i1">
</form>
Comments
  • fc_adamfc_adam FoxyCart Team
    @phayes,

    Yeah - what you're bumping into there is how we handle the add to carts. Specifically we grab all of the form data and serialize it into a string and post as the URL of the iframe.

    The work-around in this case is to get the data into the cart using a POST rather than a GET request. You can do that with a bit of javascript. This idea was applied to 0.6.0, so it's a little old and uses "$j" to access jQuery, so you'll need to replace that with "jQuery" - but it should work with a little modification: https://forum.foxycart.com/discussion/761/x
  • Great thanks. I'll take a look at that thread and report back.
  • phayesphayes Member
    edited April 2014
    With a bit of hackery I got it working. It's messy as all hell and won't display messages to the user about the items added to their cart (for example if they added too many of the same item), but it works.
    iframe = $("<iframe srcdoc='" + form[0].outerHTML + "'></iframe>").appendTo('body').load(function(){
      try {
        // It's loaded the form, submit it to add the items to the cart
        if (this.domain === undefined) {
          $(this).contents().find('form').submit();
        }
        else {
          throw('Cross-origin security policy not triggered as it should have been.');
        }
      } catch(ex) {
        // Cross-origin security policy will prevent `this.domain` from being checked and will throw an error.
        // This is expected. It means that the foxycart items have been added and we can show the cart.
        // Display the cart in a colorbox popup
        popuplink = $("<a href='https://"; + Drupal.settings.foxycart_subdomain + "/cart?fcsid=" + FC.session_id + "'></a>");
        fcc.cart_submit(popuplink[0], fcc.cart_prepare_element(popuplink[0]), 'init');
      }
    });
    
Sign In or Register to comment.