clarkk
clarkk

Reputation: 1

Zend/Google apps - delete entry - if-match og etag attribute required

When trying to delete an entry an error is returned?

Isn't you supposed just to call the delete method to delete the entry!?

$this->client = Zend_Gdata_ClientLogin::getHttpClient($this->admin_user, $this->admin_pass, 'cp');
$this->client->setHeaders('If-Match: *');
$this->gdata = new Zend_Gdata($this->client);
$this->gdata->setMajorProtocolVersion(3);

$feed = $gdata->getFeed($query);
foreach($feed as $entry){
    $entry->delete();
}

Error:

ERROR: Expected response code 200, got 403
If-Match or If-None-Match header or entry etag attribute required

Upvotes: 0

Views: 491

Answers (1)

eduardev
eduardev

Reputation: 483

Edit your file App.php and around line 538 (my case at least), that is inside function prepareRequest() change this:

if ($method == 'DELETE') {
    $rawData = null;
}

To this

if ($method == 'DELETE') {
    $rawData = null;
    $headers['If-Match'] = '*';
}

Upvotes: 2

Related Questions