Closed frhtea closed 7 years ago
Thanks for reporting this issue.
We'll need to know if this behavior is caused by a conflict with a plugin or theme. Therefore we want to ask you to do the following;
If it still occurs:
If it doesn't occur anymore:
If the problem reoccurred after reactivating one of your plugins, please add that information to your bug report.
Thanks!
Log in on your WordPress website. (OK) Deactivate all non-Yoast plugins. (OK) Switch your theme to a standard theme like Twenty Fourteen. (OK)
ADD NEW POST : The problem continues..
Help me?
Thanks for your response. How exactly can we reproduce this? Can you please tell us the exact steps you perform?
Closing this issue due to inactivity. If this issue is still relevant, please reopen with the requested information.
@thulshof ,
I am also facing the same error after upgrading the Yost SEO plugin to the latest version that is 5.2. Here is the error:
Catchable fatal error: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given in /home/aeroxtec/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 37
Can you please help to get rid of this error.
@speedyprem How can we reproduce this error? Which steps should we perform? Please provide us with the exact steps to reproduce this issue, so we can start debugging.
In the following file: public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php
Edit LINE 37: public function save_post( $post_id, WP_Post $post ) {
Should be: public function save_post( $post_id, $post ) {
I was having the same issue with WP 4.8.1 and Yoast 5.4.
I was unable to add new posts to my custom post types that I created using the CPT UI plugin. Disabling Yoast let me create new posts, but when it was enabled i got 500 errors. PHP Catchable fatal error: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given in /nas/content/live/boldfolks/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 37
When I changed the line mentioned above and did some testing, everything seemed to work fine, but I do get a warning now in my error log file. PHP Warning: Invalid argument supplied for foreach() in /nas/content/live/boldfolks/wp-content/plugins/wordpress-seo/admin/metabox/class-metabox.php on line 1067
Having this issue too. I'm unable to add any new posts to a custom post type, created with the "CPT UI" plugin.
Error in error_log: PHP Catchable fatal error: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post
I've just updated Yoast SEO plugin, but still getting the error.
Editing the class-link-watcher.php file, as suggested above, fixes this problem and allows me to add new posts.
Is this something that's going to be edited in the plugin, in a future release?
Edit: This hasn't fully fixed the issue. I can now create a new post, however, Post attributes, Format, and Custom Taxonomies are no longer being output in the back-end. Again, the custom taxonomy was created using 'CPTUI'.
Also facing this issue, can't create a new page With Yoast 5.4.2 and wordpress 4.8.2, no other plugin activated
Fatal error: Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post,null given,
called in /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-includes/class-wp-hook.php on line 300
and defined in /var/www/vhosts/werk.fr/mywpvhost.fr/web/app/plugins/wordpress-seo/admin/links/class-link-watcher.php:37
Stack trace:
#0 /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-includes/class-wp-hook.php(300): WPSEO_Link_Watcher->save_post(0, NULL)
#1 /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-includes/post.php(3510): do_action('save_post', 0, NULL, false)
#4 /var/www/vhosts/werk.fr/mywpvhost.fr/web/wp/wp-admin/includes/post.php(607): wp_insert_post(Array)
#5 /var/www/vhosts/werk.fr/bad in /var/www/vhosts/werk.fr/mywpvhost.fr/web/app/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 37
Maybe this issue should reopen ? @thulshof
Also having exactly this problem - looks like turning off "Text link counter" solved the problem for the moment.
I was having this issue as well, palmiak edit with turning off the "Text link counter" solved the error, I could not add new posts because of this issue.
I have same issue and don't know how to fix. Tried everything. Any other solution?
could you show us your error log?
Catchable fatal error: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given in /home/xxx/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 41
Wordpress Version : 4.8.3 Yoast Plugin Version : 5.7.1
And turning off Text link counter didn't help?
Unfortunately, it didn't. I turned off ;
Readability analysis Keyword analysis Advanced settings pages Ryte Admin bar menu Cornerstone content Text link counter
But I won't work. I can't Create a new page/post/custom_post_type. Also interesting thing is, I can't create any post while yoast is disabled too. Maybe I have an another problem. I will try to reinstall Wordpress. (replacing wp-admin & wp-includes).
also try disabling other plugins - just leave Yoast On 14.11.2017 14:11:36, Kamer DINC notifications@github.com napisał/a: Unfortunately, it didn't. I turned off ; Readability analysis Keyword analysis Advanced settings pages Ryte Admin bar menu Cornerstone content Text link counter But I won't work. I can't Create a new page/post/custom_post_type. Also interesting thing is, I can't create any post while yoast is disabled too. Maybe I have an another problem. I will try to reinstall Wordpress. (replacing wp-admin & wp-includes). — You are receiving this because you commented. Reply to this email directly, view it on GitHub [https://github.com/Yoast/wordpress-seo/issues/7531#issuecomment-344254351], or mute the thread [https://github.com/notifications/unsubscribe-auth/ACO-OvavpougoXPNXtEYE6B9-HpeC3SLks5s2ZGHgaJpZM4OiANE].
Thanks for your replies @palmiak . Finally I found the problem. The problem was a plugin named "theme switcha"
This helps me switching between themes for development while website is online. Problem is gone when i disable it. Also I did some MySQL tricks maybe they could help too.
Thanks again.
Hi everyone,
I am also facing the same error after upgrading the Yost SEO plugin to the latest version that is 6.3
I can't use "Add New" for pages and posts.
My data:
WordPress 4.9.4 Yoast SEO Version 6.3 Firegox is up to date - Version 58.0.2 (64-bit) Google Chrome is up to date - Version 64.0.3282.167 (Official Build) (64-bit)
Here is the error:
Fatal error: Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given, called in /home/ABC/public_html/wp-includes/class-wp-hook.php on line 288 and defined in /home/ABC/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php:41 Stack trace: #0 /home/ABC/public_html/wp-includes/class-wp-hook.php(288): WPSEO_Link_Watcher->save_post(0, NULL) #1 /home/ABC/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /home/ABC/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /home/ABC/public_html/wp-includes/post.php(3581): do_action('save_post', 0, NULL, false) #4 /home/ABC/public_html/wp-admin/includes/post.php(608): wp_insert_post(Array) #5 /home/ABC/public_html/wp-admin/post-new.php(70): get_default_post_to_edit('page', true) #6 {main} thrown in /home/ABC/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 41
My steps:
I updated Yoast SEO to Version 6.3
Wanted to make new page and I got Fatal Error.
Deactivate the plugin = didn't help.
Deactivate all plugins and go with Twenty Seventeen = didn't help.
Contact my hosting to do backup from 2 days before = didn't help.
Open support topic here: https://wordpress.org/support/topic/fatal-error-version-6-3/
Did everything form this guide: https://kb.yoast.com/kb/how-to-check-for-plugin-conflicts/
Turning off "Text link counter" and all other options = didn't help.
I didn't use CPT UI or the Theme Switcha plugins.
Used Health Check plugin.
In two tabs everything looks OK - no problems.
Debug Information:
`
Version: 4.9.4 Language: en_US Permalink structure: /%category%/%postname% Is this site using HTTPS?: Yes Can anyone register on this site?: No Default comment status: open Is this a multisite?: No User Count: 1 Communication with WordPress.org: WordPress.org is reachable Create loopback requests: The loopback request to your site completed successfully.
advanced-cache.php: Advanced caching plugin.
Name: Dynamik-Gen Version: 2.2.1 Author: The Cobalt Apps Team Author website: cobaltapps.com Parent theme: Genesis Supported theme features: menus, post-thumbnails, automatic-feed-links, genesis-inpost-layouts, genesis-archive-layouts, genesis-admin-menu, genesis-import-export-menu, genesis-readme-menu, genesis-auto-updates, genesis-breadcrumbs, genesis-menus, genesis-structural-wraps, widgets, html5
Genesis (genesis): Version 2.5.3 by StudioPress Twenty Seventeen (twentyseventeen): Version 1.4 by the WordPress team
Health Check Disable Plugins: Version 1.1
a3 Lazy Load: Version 1.8.4 by a3rev Software Anti-spam: Version 4.4 by webvitaly Autoptimize: Version 2.3.2 by Frank Goossens (futtta) Contact Form 7: Version 5.0 by Takayuki Miyoshi Disable Google Fonts: Version 1.3 by Milan Dinic Display PHP Version: Version 1.4 by David Gwyer Genesis Simple Edits: Version 2.2.0 by StudioPress Genesis Simple Share: Version 1.1.1 by StudioPress Health Check: Version 0.9.0 by The WordPress.org community Lightweight Subscribe To Comments: Version 1.5.7 by Isabel Castillo myStickymenu: Version 2.0.3 by m.r.d.a Pretty Links: Version 2.1.4 by Blair Williams PRyC WP: Add custom content to post and page (top/bottom): Version 2.4.2 by PRyC Q2W3 Fixed Widget: Version 5.1.3 by Max Bond Remove Comment Website/URL Box: Version 1.0 by Mark Hodder RSS Includes Pages: Version 3.7 by Marios Alexandrou SEO Redirection: Version 4.10 by Fakhri Alsadi Social Locker | BizPanda: Version 5.0.7 by OnePress StopBadBots: Version 4.73 by Bill Minozzi Table of Contents Plus: Version 1601 by Michael Tran Use Google Libraries: Version 1.6.2.3 by Jason Penney Widget Options: Version 3.6 by Phpbits Creative Studio WP-Optimize: Version 2.1.1 by David Anderson, Ruhani Rabin, Team Updraft WP Statistics: Version 12.3.5 by Verona Labs WP Super Cache: Version 1.5.9 by Automattic Yet Another Stars Rating: Version 1.4.8 by Dario Curvino Yoast SEO: Version 6.3 by Team Yoast Yoast SEO: Version 6.3 by Team Yoast
Active editor: WP_Image_Editor_GD Imagick Module Version: Imagick not available ImageMagick Version: Imagick not available GD Version: bundled (2.1.0 compatible) Ghostscript Version: 8.70
Server architecture: Linux 2.6.32-896.16.1.lve1.4.51.el6.x86_64 x86_64 PHP Version: 7.2.0 (Supports 64bit values) PHP SAPI: cgi-fcgi PHP max input variables: 5000 PHP time limit: 30 PHP memory limit: 256M Max input time: 60 Upload max filesize: 20M PHP post max size: 20M cURL Version: 7.38.0 OpenSSL/1.0.1e SUHOSIN installed: No Is the Imagick library available: No
Extension: mysqli Server version: 5.5.58-cll Client version: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $ Database prefix: wp_
ABSPATH: /home/ABC/public_html/ WP_HOME: Undefined WP_SITEURL: Undefined WP_DEBUG: Disabled WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG_DISPLAY: Enabled WP_DEBUG_LOG: Disabled SCRIPT_DEBUG: Disabled WP_CACHE: Enabled CONCATENATE_SCRIPTS: Undefined COMPRESS_SCRIPTS: Undefined COMPRESS_CSS: Undefined WP_LOCAL_DEV: Undefined
The main WordPress directory: Writable The wp-content directory: Writable The uploads directory: Writable The plugins directory: Writable The themes directory: Writable The Must Use Plugins directory: Writable
`
Strange in Troubleshooting Mode now I have two Yoast SEO plugins???
But I still can't use "Add New" for pages and posts because it looks so strange.
Disable Troubleshooting Mode in Health Check plugin.
Now in plugins I really have two Yoast SEO plugins - WOW.
Now I think to buy pro version but maybe the support first need to fix this problem?
I don't know. Can pro version help me or I need to wait?
Any help here please?
What other data do you need support?
Thank You,
Ivo Igantov
@ivcata Can you try deleting the plugin (both of them via FTP because I think there are two instances installed) and reinstalling? Your settings and optimizations won't be lost when you delete the plugin.
Hi,
Fatal error was there before the appearance of both Yoast SEO plugins.
I migrated with SEO Data Transporter Plugin - (to backup my SEO data).
I deactivated two Yoast SEO plugins.
When I deactivate the Yoast SEO plugin it automatically exit from my wp admin to login window.
I deleted two wordpress-seo folders.
The problem remains - see the pic:
I installed fresh new Yoast SEO.
Same Fatal error again.
Any other suggestions?
Thanks
I run into this issue with same errors symptoms about Yoast 6.3.1 either.
Found out for some occasion _WPPOSTS table lost _AUTOINCREMENT and get PRIMARY KEY on ID column after my last worpdress (4.9.4) and plugins update. And _WPPOSTS have some draft records with same ID=0.
I just roll back my BD to backuped BD (Cos fixing ID=0 records was a pain). So check that table key, maybe it's not a Yoast plugin problem.
Hi Vovka,
Thanks for your proposal.
I have got a lot of pain for last 11 days because of this bug.
Waiting for so many days without a fix. It is terrible experience.
I am a blogger, not a programmer.
That's why I don't understand very well your solution.
Can you (or someone else) explain it much simple?
Where to look? What to do? How to do it?
Thanks for your participation.
@ivcata, Try take a look on your sites database table. I am 90% sure you can find PhpMyAdmin in your hosting control for this. In PhpMyAdmin select site database and WP_POSTS table under it, go to Structure tab, and look at ID row. Is there AUTO_INCREMENT in Extra column? If no, then you have similar to my problem — to solve it backup bad database, and roll back to previous one without this error (can't help step-by-step here, it's too complex to text).
Hope I do not break off topic here.
Thanks a lot @vovkasolovev,
I believe you are right in the topic.
I will ask my hosting company to help me with this solution.
They are very good and I hope finally to FIX this problem.
My hosting company did the job and it works. The bug is gone. Finally I can blog again. Thank You @vovkasolovev
In the beginning everything was OK, but now strange things happens after my new post and pages.
Approximately after 2 hours after creation of every new page:
1.) SEO description disapear. 2.) Featured image disapear. 3.) Page Attributes - the selected from me Template is Landing and changes to Default. 4.) Some pictures in Media looks like gray rectangles (can't see what they are).
No matter how many times I will add SEO description, Featured image, and Template, they disappear again later.
Any suggestions how to fix these?
@ivcata this is most likely not caused by our plugin as you stated the problem remains after deleting both wordpress-seo folders.
There seems to be something wrong with either your database and/or your WordPress installation. Unfortunately, it doesn't look like a bug that we would be able to fix and is out of our hands. You could try reinstalling WordPress, but I'm not sure if that would fix your issues. Keep in mind, we don't recommend making any changes without a backup.
@benvaassen Thank you.
I faced the same issue and setting ID on the posts table to become primary with auto-increment fixed it :) I think this issue can be closed.
Hi @gidomanders,
Thanks for your suggestion.
My hosting support checked wp_posts and the settings are the same but I still have these bugs.
I still hoping for help here because reinstalling WordPress is a drastic step.
I did a lot of test and now I can tell what trigger these bugs.
Maybe someone can help.
The bugs appear in two scenarios:
1.) When I restore deleted post or page. It is strange but restored URL has changed.
Example: https://www.ivoignatov.com/test-1 https://www.ivoignatov.com/test-1__trashed = (restored URL)
2.) When I empty trash.
5 Bugs Are (they appear ONLY in new pages or posts):
1.) SEO description disappear. 2.) Featured image disappear. 3.) Page Attributes - the selected Template changes automatically to Default. 4.) New pictures attached to new pages or posts looks like gray icons in Media. 5.) Everytime when I deactivate Yoast SEO plugin my admin automatically log out to login WP window.
These bugs appear ONLY in new pages or posts after I restore deleted post/page or empty trash.
The old pages and posts are not affected by these bugs.
Any other suggestions how to fix them?
Ivo Ignatov
I have the same problem - no issue with my database - it's correct.
I have similar issue mentioned here: https://github.com/Yoast/wordpress-seo/issues/9403
Any solution ?
I faced the same issue
@vovkasolovev's solution worked for me!
Hi guys, Problem seems to be beceause of the fcgi. I've get the same issue when i've migrated one client worpdress site from apache2+libapache-mod-php to nginx+fpm. I try find the root cause and i'll came back with updates, if i get some.
Is anyone curious on the specific MySQL fix? I pieced together a few StackOverflow topics and found a step-by-step fix that works with PHPMyAdmin.
Given you are seeing @vovkasolovev 's 'WP_POSTS table with Error', backup your database Export
tab in PHPMyAdmin's database view
Select SQL
tab in PHPMyAdmin's database view
Enter the following two lines into the Run SQL query/queries on table
input box:
ALTER TABLE `wp_posts` ADD INDEX(`ID`);
ALTER TABLE `wp_posts` CHANGE `ID` `ID` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
Go
. Confirm with PHPMyAdmin notifications.@chippy-kennedy That solution worked for me. Thanks.
Is anyone curious on the specific MySQL fix? I pieced together a few StackOverflow topics and found a step-by-step fix that works with PHPMyAdmin.
- Given you are seeing @vovkasolovev 's 'WP_POSTS table with Error', backup your database
Export
tab in PHPMyAdmin's database view- Select
SQL
tab in PHPMyAdmin's database view- Enter the following two lines into the
Run SQL query/queries on table
input box:
ALTER TABLE `wp_posts` ADD INDEX(`ID`);
ALTER TABLE `wp_posts` CHANGE `ID` `ID` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
- Run SQL commands by pressing
Go
. Confirm with PHPMyAdmin notifications.
work for me to, thanks
This, https://github.com/Yoast/wordpress-seo/issues/7531#issuecomment-326758563 works for me, but is the plugin going to be updated with this fix? Or any update on this issue?
My ''AUTO_INCREMENT'' Error Solution (Wordpress):
Create new database (CPanel > MySQL® Databases > Create New Database > mydatabasenew Add User To Database to my old Current User
phpMyAdmin > select mydatabasenew import last undamaged (**) database
Go to your site root and find wp-config.php change wp-config.php line-18 define('DB_NAME', 'zzzzzzzzzzz_mydatabaseold'); to define('DB_NAME', 'zzzzzzzzzzz_mydatabasenew');
(**) database undamaged: open your database (from your backups) with Notepad++. Search AUTO_INCREMENT. if you find 40-60 AUTO_INCREMENT, it's undamaged.
An error of type E_ERROR was caused in line 45 of the file /home//public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php. Error message: Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given, called in /home//public_html/wp-includes/class-wp-hook.php on line 288 and defined in /home/*****/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php:45 Stack trace:
thrown
Is anyone curious on the specific MySQL fix? I pieced together a few StackOverflow topics and found a step-by-step fix that works with PHPMyAdmin.
- Given you are seeing @vovkasolovev 's 'WP_POSTS table with Error', backup your database
Export
tab in PHPMyAdmin's database view- Select
SQL
tab in PHPMyAdmin's database view- Enter the following two lines into the
Run SQL query/queries on table
input box:
ALTER TABLE `wp_posts` ADD INDEX(`ID`);
ALTER TABLE `wp_posts` CHANGE `ID` `ID` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
- Run SQL commands by pressing
Go
. Confirm with PHPMyAdmin notifications.
I have the same issue. This comment help me but it happens again after few hours. Does anyone know the root cause?
@vovkasolovev Thanks you are a genius. This worked for me!
Hi; wp 4.8, yoast 5.0.2
post-new.php not working.
tested.
error_reporting(E_ALL); ini_set(‘display_errors’, 1);
echo error.
Catchable fatal error: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given in /var/www/clients/client1/web2/web/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php on line 37
HTTP ERROR 500
I can not add new posts.
Why?
Thanks, good working..