-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add RRM module settings. #8965
Add RRM module settings. #8965
Conversation
…ement/8793-rrm-module-settings.
…ement/8793-rrm-module-settings.
…ement/8793-rrm-module-settings.
Build files for 063a2e9 have been deleted. |
Size Change: +116 B (+0.01%) Total Size: 1.57 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ankitrox, nice work so far. I've left a handful of comments, generally pretty minor ones. Please take a look.
tests/phpunit/integration/Modules/Reader_Revenue_Manager/SettingsTest.php
Show resolved
Hide resolved
tests/phpunit/integration/Modules/Reader_Revenue_ManagerTest.php
Outdated
Show resolved
Hide resolved
tests/phpunit/integration/Modules/Reader_Revenue_ManagerTest.php
Outdated
Show resolved
Hide resolved
…gle/site-kit-wp into enhancement/8793-rrm-module-settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice one @ankitrox
*/ | ||
public function on_deactivation() { | ||
$this->get_settings()->delete(); | ||
$this->reset_data_available(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Reader Revenue Manager module, as it currently stands, does not have any data to work with, hence, it should neither use the Module_With_Data_Available_State_Trait
trait, nor call the reset_data_available
function.
Is there a specific reason this was added? If not, I'm happy to remove this as part of one of my upcoming PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot @nfmohit 🦅 👁️! I missed this in CR. I believe this should indeed be removed, if you can do it via one of your forthcoming PRs that would be great.
protected function get_sanitize_callback() { | ||
return function ( $option ) { | ||
if ( isset( $option['publicationID'] ) ) { | ||
if ( ! preg_match( '/^[a-zA-Z0-9]+$/', $option['publicationID'] ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ankitrox This is inconsistent with the related check we have in JS and does not allow for a valid ID that I am trying to test with. See #8948 (comment)
@techanvil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this @aaemnnosttv, sorry I missed it during CR. As mentioned on Slack, I've got a followup PR ready if we want to reopen this issue, otherwise I'll create a separate issue for the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: The above PR has now been merged.
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist