bobbingwide / oik-tunes

Record catalogue - recordings and tracks
GNU General Public License v3.0
0 stars 0 forks source link

Recordings All Recordings and Tracks All Tracks displays nothing #1

Open bobbingwide opened 5 years ago

bobbingwide commented 5 years ago

On rowlandscastlewebdesign.com/wedding I noticed that the CPTs created by oik-tunes do not display anything when choosing Recordings > All Recordings ( https://rowlandscastlewebdesign.com/wedding/wp-admin/edit.php?post_type=oik-recording ) and Tracks > All Tracks ( https://rowlandscastlewebdesign.com/wedding/wp-admin/edit.php?post_type=oik-track )

Why not?

bobbingwide commented 5 years ago

The problem was noted with v0.1.0314 and was not fixed with v0.1.0316 It could be an issue with PHP 7.3(.9).

bobbingwide commented 5 years ago

Looks like it's an issue with the manage_edit-oik-recording_columns and manage_edit-oik-track_columns filter logic.

bobbingwide commented 5 years ago

Tracing the result of the wp_php_error_message and wp_php_error_args filters produced

C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\bwtrace-actions.php(379:32) bw_trace_results(1) 143 2019-09-25T11:42:16+00:00 0.577509 0.011825 cf=manage_edit-oik-recording_columns,wp_php_error_message 41 0 8388608/8388608 256M F=580 results: 9999,2: default output handler,zlib output compression
Array

    [0] => (string) "The site is experiencing technical difficulties. Please check your site admin email inbox for instructions."
    [1] => Array

        [type] => (integer) 1
        [message] => (string) "Uncaught ArgumentCountError: Too few arguments to function oik_tunes_oik_recording_columns(), 1 passed in C:\apache\htdocs\hm\wp-includes\class-wp-hook.php on line 286 and exactly 2 expected in C:\apache\htdocs\wordpress\wp-content\plugins\oik-tunes\oik-tunes.php:118
Stack trace:
#0 C:\apache\htdocs\hm\wp-includes\class-wp-hook.php(286): oik_tunes_oik_recording_columns(Array)
#1 C:\apache\htdocs\hm\wp-includes\plugin.php(208): WP_Hook->apply_filters(Array, Array)
#2 C:\apache\htdocs\hm\wp-admin\includes\screen.php(40): apply_filters('manage_edit-oik...', Array)
#3 C:\apache\htdocs\hm\wp-admin\includes\class-wp-screen.php(958): get_column_headers(Object(WP_Screen))
#4 C:\apache\htdocs\hm\wp-admin\includes\class-wp-screen.php(919): WP_Screen->show_screen_options()
#5 C:\apache\htdocs\hm\wp-admin\admin-header.php(259): WP_Screen->render_screen_meta()
#6 C:\apache\htdocs\hm\wp-admin\edit.php(353): require_once('C:\\apache\\htdoc...')
#7 {main}
  thrown"
        [file] => (string) "C:\apache\htdocs\wordpress\wp-content\plugins\oik-tunes\oik-tunes.php"
        [line] => (integer) 118

It turns out that these messages are in the generated HTML for the admin page; they're just not visible until you View Source.

bobbingwide commented 5 years ago

The problem is that the filter function expects two arguments but only one is passed. There is a similar problem in other plugins: oik-shortcodes, oik-themes, oik-testimonials. These plugins work since they allow set $arg2=null in the function declaration.

bobbingwide commented 11 months ago

This was fixed in e04a35c, which hasn't yet been pushed even though I made the change on 25 Sep 2019!