Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few issues related to PHPCS changes #131

Merged
merged 3 commits into from
Sep 19, 2023
Merged

Fix a few issues related to PHPCS changes #131

merged 3 commits into from
Sep 19, 2023

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Sep 13, 2023

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 to post_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

  1. Ensure you have multiple Posts added
  2. Create a new Print Issue
  3. Add a section to this Print Issue
  4. Add multiple articles to this section and save
  5. Ensure the articles persist after the save
  6. Add multiple Article Statuses
  7. Go back to the Print Issue, select multiple articles and change the Article Status
  8. Ensure the correct status shows in the list view

Changelog Entry

Fixed - Ensure multiple articles can be saved within each Print Issue section
Fixed - Ensure the article status shows correctly and can be bulk edited

Credits

Props @dkotter, @xLesy

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 1.2.3 milestone Sep 13, 2023
@dkotter dkotter self-assigned this Sep 13, 2023
@dkotter dkotter requested a review from a team as a code owner September 13, 2023 17:25
@dkotter dkotter requested review from Sidsector9 and removed request for a team September 13, 2023 17:25
@dkotter dkotter linked an issue Sep 13, 2023 that may be closed by this pull request
4 tasks
@dkotter dkotter requested review from iamdharmesh and removed request for Sidsector9 September 18, 2023 14:14
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dkotter dkotter merged commit 8310939 into develop Sep 19, 2023
@dkotter dkotter deleted the fix/130 branch September 19, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add more than 1 post to a section Upgrade Cypress to version 13
2 participants