Open bobbingwide opened 5 years ago
Also, when rerunning the build locally I saw
Processing: end_lvl,Walker_Page::end_lvl,wp-includes/class-walker-page.php
Warning: count(): Parameter must be an array or an object that implements Countable in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\shortcodes\oik-api-importer.php on line 502
Warning: count(): Parameter must be an array or an object that implements Countable in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\shortcodes\oik-api-importer.php on line 1129
Investigation of 1. indicates that uncommenting a commented out bw_flush()
in oikai_build_apiref()
resolves the problem... but I don't know why. It would appear that the problem occurs in oikai_listsource()
when $parsed_source is null... meaning that we can't use the parsed_source entry.
Further investigation, in which I needed to actually use Xdebug for the first time in over 2 years, indicates that the problem occurs when a new hook
is created.
Yoast SEO hooks into save_post
and the post_content is expanded in WPSEO_Link_Watcher logic.
Because the post's content includes [bw_fields] this shortcode is expanded. The shortcode invokes bw_ret()
to return the echo'd content.
Since no bw_push()
has been done the content returned includes all the stuff echo'd so far for the current post.
This content is therefore lost.
bw_flush()
in oikai_build_apiref
oikai_syntax_source
in oikai_navi_source
as below bw_push();
oikai_syntax_source( $selection, 1 );
$parsed = bw_ret();
bw_pop();
e( $parsed );
bw_push();
$post_id = _oikai_create_oik_hook( $hook, $context );
bw_pop();
Hook functions attached to save_post
are
: 10 delete_get_calendar_cache;1 WPSEO_Link_Watcher::save_post;2 WPSEO_Post_Type_Sitemap_Provider::save_post;1 bw_effort_save_postdata;3
These are attached even when it's the front-end.
I chose a belt and braces solution:
Now for wp-a2z being ahead. This is associated with the bobbingwide/wp-a2z repo.
git pull --rebase
with a bit of fiddling of .gitignore
got it to 1 commit ahead..gitignore
will make it 2 commits ahead.For the third problem. Pushing the changes from wp-a2z.org back into the master, pulling it and updating .gitignore a little more enabled me to get the missing commit into my local version. I'm completely rebuilding core.wp.a2z, but the other subdomains in the local version seem to update correctly.
- Remove all filters attached to 'save_post'
This was the main problem in #71. It unintentionally removed the filter function provided by oik_fields
which saves the post meta data set in the $_POST global variable.
The problem didn’t occur until the second API is processed.
The QAD fix is to re-add oik-field’s filter function.
It would be more efficient if this was done outside of the main loop. Maybe I should start implementing peer reviews.
Three things.
wp_insert_site
is incomplete.. It's not showing any of the sections before the source code: Description, Usage, Parameters, Returns, Source etc.