Fix(snippet): Error that occurred when there were no linked resources in the document #372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When there are no linked resources in the document and the snippet getSelections is called, an error occurs due to an incorrectly composed query "sortby FIELD(...) in getSelections snippet (on line 94).
Error: Error 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') asc LIMIT 10' at line 1
Also, as far as I understand, it makes no sense to call the snippet getResources (pdoResources) if we already know that there are no linked resources. I suggest returning an empty result immediately if there are no linked resources in the document.