New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yoast SEO plugin v9.0.3 Causes Compilation failed Error #313

Open
RehanSaeed opened this Issue Nov 2, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@RehanSaeed
Copy link

RehanSaeed commented Nov 2, 2018

I updated my version of the Yoast SEO plugin to 9.0.3 and started getting the following errors at the top of my blog site at rehansaeed.com.

Warning: preg_replace(): Compilation failed: missing ) at offset 246 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 247 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 248 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 249 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 246 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 247 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 248 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 249 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483

I've now uninstalled the plugin and even deleted it, then re-synced Project Nami from Azure deployments but the error remains. Any ideas on how I can fix this issue?

image

@bcserverteam

This comment has been minimized.

Copy link

bcserverteam commented Nov 20, 2018

The new version of Yoast (9.x ?) has a few issues on NAMI.

#284
#169

The quick and simple fix with this one is to edit the fields_map.parsed_types.php file in the wp-includes/ folder and update the mappings to include a paren at the end.

One of them will look something like:
yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction'

But should look like:
yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction )'

Not sure why it is doing this, but each time you reinstall the plugin or disable/reenable it, it will mess up that file again. You'll have to touch it by hand each time. Additionally, we now have translation issues with Yoast I have yet to be able to track down.

@NoralK

This comment has been minimized.

Copy link

NoralK commented Dec 20, 2018

This was happening to me as well. I have Yoast SEO v9.3 working with Project Nami v2.0.1.

The previous fix #169 did not fix the issue but I did keep it, just in case. What I did was this. Edit the translations.php file located in wp-includes and add these lines just after line 1482, which is foreach($operators as $oper => $val) {.

//line 1483
                    if ($table === 'wp_search_terms ( id bigint(20) NOT NULL AUTO_INCREMENT, search_term varchar(256) NOT NULL, search_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY') $table .= ')';
//line 1485
                    if ($table === 'wp_yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction') $table .= ')';

Do not change the spacing in the query or it will fail the if/then.

Reload the Projects page or the Pages page and no more error.

If there are further issues just dump out the SQL statement by putting an

//line 1487
                    echo $table;

before the $query assignments so you can see the failing SQL statement. Hopefully it is something easy like a missing ).

Hope this helps.
Cheers

@RehanSaeed

This comment has been minimized.

Copy link
Author

RehanSaeed commented Dec 20, 2018

Is there a more permantent fix coming? I'd rather wait than hack around with PHP files.

@patrickebates

This comment has been minimized.

Copy link
Member

patrickebates commented Dec 21, 2018

I believe the permanent fix will be to finally end the association with the fields map. It's a holdover from the plugin which the translation engine was adapted from. I think it might be replaced by querying the table structure from the DB, but haven't had the time to pursue it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment