Filter API results Server Side

I think there may be cases where the title property isn’t present (not just empty) so it throws the error in the loop of the where function

1 Like

That seems highly likely. I’ll look through all the albums and see if I can find an emty title.

You could unzip the collections.php file from here to the dmxConnectLib/lib/formatters/ folder

collections.php.zip (1.6 KB)

just rename the previous version to something like collectionsOLD.php first. If anything doesn’t work you can just delete the new file and rename collectionsOLD.php back to collections.php

If it works it will confirm that the Wappler team might need to account for occasions where the property isn’t present

You’re a legend Ben!

There was one album that had a title of something like 2016-09-07 but that wasn’t coming through the data so that album had no title field. I’m guessing it was reading it as a date and chucking a wobbly. Changed that title and all is well!

Thanks so much!!!

1 Like

@patrick - this seems to be resolved with a workaround for Heather but could you (or someone in the team) have a look at the where formatter on PHP. If the property is missing (not just empty) it throws an error (undefined key). Adding an if(isset($o[$prop])){...} to the where formatter appears to resolve it.

Will be in the next update. Added the line if (!isset($o[$prop])) continue; to skip the items where the property is missing.

collections.zip (1.2 KB)

1 Like

Fixed in Wappler 5.3.2

This topic was automatically closed after 47 hours. New replies are no longer allowed.