If you are getting an “Invalid Argument” error with Google Photos …
-
Google made an unannounced change to its Photos API on 29th or 30th August, wherein it changed the maximum number of photos returned in a single API call to 100 from 500.
Unfortunately this is a breaking change – if you pass a number > 100 the API returns an error … and this affects Photonic. Photonic by default displays the maximum permissible number of photos or albums to minimize API calls, so if you don’t pass a count or photo_count parameter to the shortcode, it will default the value to 500. As a result of this a shortcode that was working until 29th August might now not work. To remedy this you have two options:
- Go to the file wp-content/plugins/photonic/extensions/Photonic_Google_Photos_Processor.php, line 52. You will see this:
'count' => 500,
Change it to this:
'count' => 100,
Save the file, and all your shortcodes will be fine now.
- If you are uncomfortable making the code change above you can explicitly define the count=100 attribute on shortcodes for Google Photos. This will take a bit more effort on your part, but will be just as effective.
Why am I not releasing this fix myself? I am about 75% done with some big changes to the plugin, so I don’t want to release the above as a patch and disrupt something else unwittingly.
It has been included with the next version of the plugin though, so the next time you update the plugin your change will not be lost.
- Go to the file wp-content/plugins/photonic/extensions/Photonic_Google_Photos_Processor.php, line 52. You will see this:
- The topic ‘If you are getting an “Invalid Argument” error with Google Photos …’ is closed to new replies.