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

SIT-3060: Change sectionNames to allSections field #275

Merged
merged 7 commits into from
May 17, 2022

Conversation

oscarssanchez
Copy link
Contributor

Description of the Change

Here we are just swapping the sectionNames field to allSections per new Sophi fields.

Alternate Designs

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

@oscarssanchez oscarssanchez requested a review from jeffpaul May 12, 2022 18:02
@jeffpaul jeffpaul added this to the 1.1.1 milestone May 12, 2022
@@ -269,7 +269,7 @@ function get_post_data( $post ) {
'publishedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_date_gmt ) ),
'plainText' => wp_strip_all_tags( $content ),
'size' => str_word_count( wp_strip_all_tags( $content ) ),
'sectionNames' => Utils\get_post_categories( $post->ID ),
Copy link
Contributor

Choose a reason for hiding this comment

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

we want to keep this field as the next step in a subsequent release will change the data in the sectionNames field to hold the Primary Category

@@ -269,7 +269,7 @@ function get_post_data( $post ) {
'publishedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_date_gmt ) ),
'plainText' => wp_strip_all_tags( $content ),
'size' => str_word_count( wp_strip_all_tags( $content ) ),
'sectionNames' => Utils\get_post_categories( $post->ID ),
'allSections' => Utils\get_post_categories( $post->ID ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this new field sending the category data across in the following requested sample format showing multiple, nested categories?:

['/world/asia-pacific','/business/healthcare-pharmaceuticals','/world']

@jeffpaul
Copy link
Contributor

@oscarssanchez what's your ETA on getting this PR ready for merge/release?

$categories = get_the_category( $post_id );
$paths = [];

foreach ( $categories as $category ) {
Copy link

Choose a reason for hiding this comment

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

might be worth adding some validation / casting in here just in case something hooks into get_the_categories filter and returns something odd.

Copy link
Contributor

Choose a reason for hiding this comment

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

@tott are you ok with the latest changes on this?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jeffpaul
Copy link
Contributor

Noting that @oscarssanchez confirmed with @tott offline on approval of the changes here, so going to merge in for the 1.1.1 milestone release

@jeffpaul jeffpaul merged commit 5741925 into develop May 17, 2022
@jeffpaul jeffpaul deleted the feature/all-sections branch May 17, 2022 17:39
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.

SIT-3060: Allow for handling of more than one set of hierarchical Categories on posts
3 participants