Tagged: 

Viewing 8 reply threads
  • Author
    Posts
    • #4710

      I get an error when I visit the posts page in the admin.

      Notice: Undefined variable: priority in /Applications/MAMP/htdocs/si14/site/web/app/plugins/wp-helpers/wp-helpers.php on line 469

      It looks like $wp_filter is sometimes null, and the call to “extract” on 457 won’t extract the $priority variable.

      This is on Piklist 0.9.9.4

    • #4736
      Steve
      Keymaster

      v1.8.9 is now at WordPress.org. Please update and let us know if your issue is resolved.

    • #4766

      This update did not fix the error, I urge you to install https://github.com/roots/soil, and activate all of the settings to see what I mean. Your plugin removes certain actions using “remove_action”, if any other installed plugin does this, then you will run into the case where you attempt to remove an action that has already been removed, and your call to “extract” will be called on an empty filter, and none of the variables that you expect to have will be there, namely, the $priority variable, which you assume exists on line 471. You need to make sure that the extracted variables exist.

    • #4784
      Steve
      Keymaster

      Here’s what I did:
      1) Install Soil
      2) Add to functions.php:
      add_theme_support(‘soil-clean-up’);
      add_theme_support(‘soil-disable-trackbacks’);
      3) In Helpers, I clicked on the “Appearance” tab and checked off everything from “Remove from template header”.

      I received no errors. Please let me know if I’m doing this correctly.

    • #5147
      mcmaster
      Member

      I just ran into the same error with WP Helpers 1.9.3. I am starting two new websites, and I ran through my configuration on the two in parallel. They are still running on Twenty-Fifteen theme. Did almost identical settings in WP-Helpers. And now one of them is displaying the following error (actually 6 lines as the 3 lines below are repeated) every time I go into the List view for Posts or Pages. The other one is not displaying the error.

       Notice: Undefined variable: priority in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488
      Notice: Undefined variable: priority in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488
      Notice: Undefined index: in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488
      

      Line 488 in WP Helpers 1.9.3 is:

            	if ( !isset( $wp_filter[$filter][$priority] ) ) {
      

      The value of $filter is wp_head. This is the value of $wp_filter[$filter]:

          [wp_head] => Array
              (
                  [1] => Array
                      (
                          [_wp_render_title_tag] => Array
                              (
                                  [function] => _wp_render_title_tag
                                  [accepted_args] => 1
                              )
      
                          [wp_enqueue_scripts] => Array
                              (
                                  [function] => wp_enqueue_scripts
                                  [accepted_args] => 1
                              )
      
                          [noindex] => Array
                              (
                                  [function] => noindex
                                  [accepted_args] => 1
                              )
      
                          [wp_post_preview_js] => Array
                              (
                                  [function] => wp_post_preview_js
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [10] => Array
                      (
                          [locale_stylesheet] => Array
                              (
                                  [function] => locale_stylesheet
                                  [accepted_args] => 1
                              )
      
                          [rel_canonical] => Array
                              (
                                  [function] => rel_canonical
                                  [accepted_args] => 1
                              )
      
                          [wp_shortlink_wp_head] => Array
                              (
                                  [function] => wp_shortlink_wp_head
                                  [accepted_args] => 0
                              )
      
                          [piklist_admin::admin_head] => Array
                              (
                                  [function] => Array
                                      (
                                          [0] => piklist_admin
                                          [1] => admin_head
                                      )
      
                                  [accepted_args] => 1
                              )
      
                          [piklist_theme::version_in_header] => Array
                              (
                                  [function] => Array
                                      (
                                          [0] => piklist_theme
                                          [1] => version_in_header
                                      )
      
                                  [accepted_args] => 1
                              )
      
                          [000000005c99777b000000014e3d5fbarecent_comments_style] => Array
                              (
                                  [function] => Array
                                      (
                                          [0] => WP_Widget_Recent_Comments Object
                                              (
                                                  [id_base] => recent-comments
                                                  [name] => Recent Comments
                                                  [widget_options] => Array
                                                      (
                                                          [classname] => widget_recent_comments
                                                          [description] => Your site’s most recent comments.
                                                      )
      
                                                  [control_options] => Array
                                                      (
                                                          [id_base] => recent-comments
                                                      )
      
                                                  [number] => 
                                                  [id] => 
                                                  [updated] => 
                                                  [option_name] => widget_recent-comments
                                                  [alt_option_name] => widget_recent_comments
                                              )
      
                                          [1] => recent_comments_style
                                      )
      
                                  [accepted_args] => 1
                              )
      
                          [twentyfifteen_header_style] => Array
                              (
                                  [function] => twentyfifteen_header_style
                                  [accepted_args] => 1
                              )
      
                          [_custom_background_cb] => Array
                              (
                                  [function] => _custom_background_cb
                                  [accepted_args] => 1
                              )
      
                          [wp_admin_bar_header] => Array
                              (
                                  [function] => wp_admin_bar_header
                                  [accepted_args] => 1
                              )
      
                          [_admin_bar_bump_cb] => Array
                              (
                                  [function] => _admin_bar_bump_cb
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [7] => Array
                      (
                          [print_emoji_detection_script] => Array
                              (
                                  [function] => print_emoji_detection_script
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [8] => Array
                      (
                          [wp_print_styles] => Array
                              (
                                  [function] => wp_print_styles
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [9] => Array
                      (
                          [wp_print_head_scripts] => Array
                              (
                                  [function] => wp_print_head_scripts
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [99] => Array
                      (
                          [wp_site_icon] => Array
                              (
                                  [function] => wp_site_icon
                                  [accepted_args] => 1
                              )
      
                      )
      
                  [0] => Array
                      (
                          [piklist_theme::register_assets_head] => Array
                              (
                                  [function] => Array
                                      (
                                          [0] => piklist_theme
                                          [1] => register_assets_head
                                      )
      
                                  [accepted_args] => 1
                              )
      
                          [twentyfifteen_javascript_detection] => Array
                              (
                                  [function] => twentyfifteen_javascript_detection
                                  [accepted_args] => 1
                              )
      
                      )
      
              )
      

      I see here https://piklist.com/support/topic/notices-on-a-custom-post-type/ that you requested the wp-helpers configuration. Let me know if something like that for the two sites (with errors and without) would be useful.

      Cheers,
      Donna

    • #5148
      mcmaster
      Member

      One more note: this occurs when the tag is ‘feed_links’ and again for ‘feed_links_extra’.

    • #5167
      Steve
      Keymaster

      Are you sure you’re running v1.9.3?

      I can’t find if ( !isset( $wp_filter[$filter][$priority] ) ) {here:
      http://plugins.svn.wordpress.org/wp-helpers/tags/1.9.3/wp-helpers.php

    • #5168
      mcmaster
      Member

      I am running v1.9.3, but I had modified a line in an attempt to turn off the error. I apologize for the confusion. I just downloaded a fresh copy of 1.9.3 and verified that the problem still exists.

      Line 488 is:

              remove_action($filter, $tag, $priority, $wp_filter[$filter][$priority][$tag]['accepted_args']);
      

      In some cases, $priority is not set. I turned off the error messages by changing line 486 to add a check for $priority:

            if(!empty($filter) && isset($priority) )
      

      But I don’t know whether that’s fixing the problem or merely camouflaging the error.

      Let me know if you’d like access to a test site that’s still logging this error.

      Donna

    • #6046
      Steve
      Keymaster

      v1.9.5 should fix the issue.

Viewing 8 reply threads
  • The topic ‘Error on admin post pages [WP-Helpers 1.8.8]’ is closed to new replies.