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: tags_as_class #227

Closed
sewid opened this issue Jan 17, 2017 · 4 comments
Closed

Undefined index: tags_as_class #227

sewid opened this issue Jan 17, 2017 · 4 comments

Comments

@sewid
Copy link

sewid commented Jan 17, 2017

Hi there,

when using the plugins widget, I get this notification when WP_DEBUG is enabled:

Undefined index: tags_as_class in /X/Y/Z/wp-content/plugins/list-category-posts/include/lcp-catlistdisplayer.php on line 243

Best regards,
Sebastian

@alejandro-angulo
Copy link
Contributor

Thanks for reporting this! I should have caught this when I submitted my earlier PR ( #218 ). I can probably write a test to check for these kinds of errors/warnings.

I submitted a pull request to fix this here: #228 .

@picandocodigo
Copy link
Owner

Sorry for the delay in accepting the PR. The plugin's being updated on WordPress.org's svn server as I'm writing this. Version 0.71.1 should be up in a few minutes and fix this. Thanks @vacuus!!!

@hhenshaw
Copy link

hhenshaw commented Feb 2, 2017

I'm running 0.71.1 and am getting the following: Notice: Undefined index: tags_as_class in /X/wp-content/plugins/list-category-posts/include/lcp-widget.php on line 40.

@lucadima15
Copy link

By now I've solved substituting this row:

$tags_as_class = ($instance['tags_as_class'] == 'yes') ? 'yes' : 'no';

with these:

if(array_key_exists('tags_as_class', $instance))
{
$tags_as_class = ($instance['tags_as_class'] == 'yes') ? 'yes' : 'no';
}
else
{
$tags_as_class = '';
}

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

No branches or pull requests

5 participants