OussamaOBO / gshoppingcontent-php

Automatically exported from code.google.com/p/gshoppingcontent-php
Other
0 stars 0 forks source link

Products retrieved from getProducts() cannot be used with updateProduct #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
## What steps will reproduce the problem?

// ...Create a $client that is authorized. Then:
$products = $client->getProducts(1)->getProducts();
$product = $products[0];
// [...make a change to the product...]
$client->updateProduct($product);

## What is the expected output? What do you see instead?

Expected: Product is updated
Actual: 

PHP Fatal error:  Uncaught <errors xmlns="http://schemas.google.com/g/2005">
  <error>
    <domain>GData</domain>
    <code>ParseException</code>
    <internalReason>The prefix "gd" for attribute "gd:etag" associated with an element type "entry" is not bound.</internalReason>
  </error>
</errors>

Original issue reported on code.google.com by msca...@google.com on 21 Nov 2013 at 2:40

GoogleCodeExporter commented 8 years ago
The problem is that when the individual product is sent to the server we take 
the XML fragment for that node. This doesn't include the namespace declarations.

We need to create a new document and import the node into that. Then PHP will 
correctly add the appropriate namespaces for us.

Original comment by msca...@google.com on 21 Nov 2013 at 2:42