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

Undefined index: master_site_setting in /wp-content/plugins/multisite-post-duplicator/addons/restrictSites-mpd-addon.php on line 325 #64

Open
Jon007 opened this issue Jul 22, 2018 · 1 comment · May be fixed by #73

Comments

@Jon007
Copy link

Jon007 commented Jul 22, 2018

In certain circumstances it is possible to produce:
Notice: Undefined index: master_site_setting in /wp-content/plugins/multisite-post-duplicator/addons/restrictSites-mpd-addon.php on line 325

This can be resolved in this case by testing if the option is set:

	$options = get_option( 'mdp_settings' );
	if ( isset( $options[ 'master_site_setting' ] ) ) {
		$master_id = $options[ 'master_site_setting' ];

though a better solution is to ensure default options are always available plugin-wide

@Jon007 Jon007 linked a pull request Jul 28, 2018 that will close this issue
@michaelw85
Copy link

michaelw85 commented Feb 26, 2021

For anyone stumbling upon this page as I did here's how to fix it without code changes.
This setting is available on the network level and by default is not set.

  • Go to the plugin settings
  • Set Restrict MPD to certain sites to Select a Master Site
  • This will show the Select a Master Site dropdown, choose your master site, and save.

After this, the option is set and exists preventing the error. You can now change back the "Restrict MPD" setting to what you want.

IMHO, this should be resolved in the plugin by either requiring this setting to be configured regardless of the restrict setting or code should check if it is set and perform the expected behavior when set.

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 a pull request may close this issue.

2 participants