asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
544 stars 152 forks source link

No link found with rel "edit" i Google\Spreadsheet\Util::getLinkHref() #160

Open ludberg opened 8 years ago

ludberg commented 8 years ago

I get this error when trying to update an entry.

Step 1) Published spreadsheet

Step 2) Using this code

$serviceRequest = new DefaultServiceRequest($accessToken);
ServiceRequestFactory::setInstance($serviceRequest);

$spreadsheetService = new Google\Spreadsheet\SpreadsheetService();
$worksheetFeed  = $spreadsheetService->getPublicSpreadsheet("<MY ID>");

$worksheet = $worksheetFeed->getByTitle('SHEETNAME');
$listFeed = $worksheet->getListFeed(["sq" => "published = 0 && datum = ".date("Y-m-d", time()) . " && tid < ".date("Hi", time()), "reverse" => "true"]);

foreach ($listFeed->getEntries() as $entry) {
    $values = $entry->getValues();
    $values["published"] = "1"; // Updating column with name Published
    $entry->update($values); // CRASH
}