• As always, great plugin, thanks for your time in creating and maintaining it.

    I’ve come across an edge case “bug”. It relies on carelessness of others, so may not justify fixing…to trigger it:

    1. Add a custom post type
    2. Add the post type to FPW via fpw_post_types
    3. Create a FPW Widget that points to a post of that type
    4. Remove the custom post type (deactivate plugin, say)
    5. Don’t remove the post type from fpw_post_types

    This can cause FPW to trigger a PHP warning via this code in fpw_helper_functions.php:

    `
    85 $post_type_object = get_post_type_object( $type );
    86 $name = $post_type_object->labels->name;
    `

    Line 85 will return null; line 86 will generate a “trying to get properties of a non-object” warning.

    Fix should be fairly simple, something like:

    `
    85 $post_type_object = get_post_type_object( $type );
    86
    87 if ( $post_type_object === null ) continue;
    88
    89 $name = $post_type_object->labels->name;
    `

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rogerlos

    (@rogerlos)

    (Do they really not have ‘block o’ code tags here? Sorry about formatting!)

    Plugin Author mrwweb

    (@mrwweb)

    Thanks for reporting this, @rogerlos! That’s a very valid bug, and seems quite worth fixing! I agree with you that it’s not urgent, but I still appreciate the report and will get a fix out!

    (Code formatting does work with single backticks. I always use the code button in the editor since I can never track which sites use 1 backtick and which use 3.)

    <?php echo $something; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘fpw_helper_functions: minor bug’ is closed to new replies.