Fix a few issues related to PHPCS changes #131
Merged
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.
Description of the Change
In #120, a bunch of PHPCS fixes were added. While these are great, they can often have unintended consequences. As reported in #130, you can only save a single article within a section now. In looking into this, the problem is we added a sanitization method around those articles IDs when they are saved. These IDs are sent in as a comma-separated list of integers but the sanitization method used (
intval
) converts that into a single integer (thus getting rid of any articles besides the first.I don't think we need this sanitization anyway, as we later have a check to verify that each item is an integer in this comma-separated list, so this PR removes that extra sanitization which fixes the reported issue.
In addition, I decided to look closer at the code changes in #120 and found the exact same issue in regards to bulk editing the article status of articles within a section. We added the same sanitization method and thus changing the article status only works if you have a single article selected (you'll get an error if multiple are selected).
I also noticed the information in the Article Status column wasn't reflecting the actual Article Status assigned. Looking into that, this was an issue coming out of #117, where we changed the column name from
article_status
topost_status
. As far as I can tell there's no need for that change so I've changed that back in this PR, which fixes the bug around those showing correctly.And finally, E2E tests aren't working since #129 was merged in, as the upgrade to Cypress 13 required some changes in our test structure. That has been fixed in this PR.
Closes #130, #125
How to test the Change
Changelog Entry
Credits
Props @dkotter, @xLesy
Checklist: