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

Bypass post meta, first pass #16628

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft

Bypass post meta, first pass #16628

wants to merge 1 commit into from

Conversation

jdevalk
Copy link
Contributor

@jdevalk jdevalk commented Feb 4, 2021

Context

  • This enables, behind a feature flag, a complete bypass of all the post_meta, user_meta and term_meta fields.

⚠️ WIP ⚠️

Summary

This PR can be summarized in the following changelog entry:

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #

@jdevalk jdevalk added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Feb 4, 2021
return $check;
}
$field = $this->map_meta_indexable[ $key ];
$indexable = $this->indexable_repository->find_by_id_and_type( $object_id, $meta_type, false );
Copy link
Contributor

Choose a reason for hiding this comment

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

Passing false to the auto-create here means this can potentially return false instead of an indexable.

Given we want to be sure to store the data I'd recommend not passing the third argument so the indexable is auto-created.

Do note that even in that case it's still possible for false ( for indexables that should not be indexed ) or an indexable with the post_status unindexed to be created ( for indexables of objects that do not exist ).

if ( $indexable === false || $indexable->post_status === 'unindexed' ) {
    return false;
}

return $value;
}
$field = $this->map_meta_indexable[ $key ];
$indexable = $this->indexable_repository->find_by_id_and_type( $object_id, $meta_type, false );
Copy link
Contributor

Choose a reason for hiding this comment

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

This could also return false if the indexable hasn't been created yet ( not creating it is fine as we there'd be no data to read.

If the $indexable is false we should likely return false here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should return the $check value, but yeah agreed. fixing.

@IreneStr
Copy link
Contributor

@jdevalk Is this still relevant or can it be closed?

@jdevalk
Copy link
Contributor Author

jdevalk commented Sep 23, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants