WPIntell

Source evidence

php error

List all posts by Authors, nested Categories and Titles · support · 2023-06-26T04:02:00+00:00

mixedsentiment
mediumseverity
0.78relevance
16replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 31 rows with source links

19.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

25 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
josflachs resolved
Hi Fabio, I just found your plugin. It works like a charm, but I get a nasty php error I don’t know how to solve: Warning : Attempt to read property “term_id” on bool in /home/xxx/Local Sites/gates/app/public/wp-content/plugins/list-all-posts-by-authors-nested-categories-and-titles/include/ACT-displayer.php on line 280 I’m working on Local by Flywheel with Elementor on Ubuntu. (no live example). Here’s a screenshot: https://snipboard.io/J5vriG.jpg How do I solve this problem? This topic was modified 2 years, 11 months ago by josflachs . I will have a look, but it is a Warning, so it doesn’t hurt. In the meantime, disable WP_DEBUG in your wp-config.php What version of php and WordPress are you running? This reply was modified 2 years, 11 months ago by fmarzocca . Be sure that each of your Category has a slug. Woa! You’re fast! All categories have a slug (just checked to make sure) WP: 6.2.2 PHP: 8.1.9 wpconfig: define( ‘WP_DEBUG’, false ); This reply was modified 2 years, 11 months ago by josflachs . Mmmh. I haven’t tried yet with php 8… Can you pls post the Shortcode you are using to display that page? [ACT-list show='Author'] This is mine, working: [ACT-list show="Author" exclude="News" reverse-date=1 postdate=1 ] Don’t you have unpublished articles, or orphaned/unclassified categories? The error is coming from an invalid category, but this is the first time I see it. Don’t you have the chance to switch to PHP 7.x for a test? In any case, if WP_DEBUG is false, it must not display that warning. define('WP_DEBUG', FALSE); This reply was modified 2 years, 11 months ago by fmarzocca . I switch to the obsolete 7.4 version: that works. 8.02 gave me the error again. So it has something to do with the +8 PHP versions. The WP_DEBUG is false, but it does show the error nevertheless. Ok. Thank you! I’m not going live with a site on php 7.4. When do you think the plugin will be upgraded? This reply was modified 2 years, 11 months ago by josflachs . At the moment I have no plans to update to php 8, but can you pls make a test? Create an empty Category (i.e.: test) and then exclude that category from your shortcode: [ACT-list show="Author" exclude="test"] It works! Thanks Fabio, you’re great. Can I take advantage of your courtesy? If you edit the file ACT-displayer.php in: wp-content/plugins/list-all-posts-by-authors-nested-categories-and-titles/include go to the very end of the file and replace the function get_cats_by_slug with this one: function get_cats_by_slug($catslugs) { $catids = array(); foreach($catslugs as $slug) { if (!get_category_by_slug($slug) ) break; $catids[] = get_category_by_slug($slug)->term_id; } return $catids; } Then remove the exclude in the shortcode and let me know if it works. In such a case I will deploy a new version. Of course, I just did it and it works fine. Great! New version 2.7.10 is online. You can update the plugin. Thank you very much

Comments

16 shown
fmarzocca 2023-06-26T07:41:00+00:00

I will have a look, but it is a Warning, so it doesn’t hurt. In the meantime, disable WP_DEBUG in your wp-config.php What version of php and WordPress are you running? This reply was modified 2 years, 11 months ago by fmarzocca .

fmarzocca 2023-06-26T08:04:00+00:00

Be sure that each of your Category has a slug.

josflachs 2023-06-26T08:41:00+00:00

Woa! You’re fast! All categories have a slug (just checked to make sure) WP: 6.2.2 PHP: 8.1.9 wpconfig: define( ‘WP_DEBUG’, false ); This reply was modified 2 years, 11 months ago by josflachs .

fmarzocca 2023-06-26T09:49:00+00:00

Mmmh. I haven’t tried yet with php 8…

fmarzocca 2023-06-26T09:55:00+00:00

Can you pls post the Shortcode you are using to display that page?

josflachs 2023-06-26T10:12:00+00:00

[ACT-list show='Author']

fmarzocca 2023-06-26T10:16:00+00:00

This is mine, working: [ACT-list show="Author" exclude="News" reverse-date=1 postdate=1 ] Don’t you have unpublished articles, or orphaned/unclassified categories? The error is coming from an invalid category, but this is the first time I see it. Don’t you have the chance to switch to PHP 7.x for a test?

fmarzocca 2023-06-26T10:40:00+00:00

In any case, if WP_DEBUG is false, it must not display that warning. define('WP_DEBUG', FALSE); This reply was modified 2 years, 11 months ago by fmarzocca .

josflachs 2023-06-26T12:43:00+00:00

I switch to the obsolete 7.4 version: that works. 8.02 gave me the error again. So it has something to do with the +8 PHP versions. The WP_DEBUG is false, but it does show the error nevertheless.

fmarzocca 2023-06-26T13:35:00+00:00

Ok. Thank you!

josflachs 2023-06-27T06:38:00+00:00

I’m not going live with a site on php 7.4. When do you think the plugin will be upgraded? This reply was modified 2 years, 11 months ago by josflachs .

fmarzocca 2023-06-27T08:22:00+00:00

At the moment I have no plans to update to php 8, but can you pls make a test? Create an empty Category (i.e.: test) and then exclude that category from your shortcode: [ACT-list show="Author" exclude="test"]

josflachs 2023-06-27T08:31:00+00:00

It works! Thanks Fabio, you’re great.

fmarzocca 2023-06-27T09:10:00+00:00

Can I take advantage of your courtesy? If you edit the file ACT-displayer.php in: wp-content/plugins/list-all-posts-by-authors-nested-categories-and-titles/include go to the very end of the file and replace the function get_cats_by_slug with this one: function get_cats_by_slug($catslugs) { $catids = array(); foreach($catslugs as $slug) { if (!get_category_by_slug($slug) ) break; $catids[] = get_category_by_slug($slug)->term_id; } return $catids; } Then remove the exclude in the shortcode and let me know if it works. In such a case I will deploy a new version.

josflachs 2023-06-27T10:00:00+00:00

Of course, I just did it and it works fine.

fmarzocca 2023-06-27T10:21:00+00:00

Great! New version 2.7.10 is online. You can update the plugin. Thank you very much