Skip to content
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

Missing closing ) in translation.php on line 1454 #169

Closed
klompenrunner opened this issue Jan 6, 2017 · 13 comments
Closed

Missing closing ) in translation.php on line 1454 #169

klompenrunner opened this issue Jan 6, 2017 · 13 comments

Comments

@klompenrunner
Copy link

klompenrunner commented Jan 6, 2017

I am getting 30 of this errors when viewing a page:

Warning: preg_replace(): Compilation failed: missing ) at offset ??? in ......\wp-includes\translations.php on line 1454

Where ??? is 225, 226, 229, 230, 184 or 185

The issue is with the $table variable; there is missing a closing parenthesis, example:

wp_datalist ( url varchar(255) NOT NULL, title varchar(255) NOT NULL, keywords varchar(255) NOT NULL, description varchar(255) NOT NULL, content longtext NOT NULL, full_content smallint(6) NOT NULL, PRIMARY KEY

My temporary fix was to add a parenthesis after $table in\wp-includes\translations.php on row 1454, but that breaks some other plugins:
$query = preg_replace('/\s+'.$table . ').' . $field.'\s*'.$oper.'/i', ' '.$table . '.' . $field . ' ' . $val, $query);

My temp fix currently is this addition to fix that one string, added to \wp-includes\translations.php on row 1446
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 .= ')';

(Note: there are some double spaces in that string; 2 spaces before id and 2 spaces after every comma!!!!)

Wish I could be of more help; love what you guys did by making WP work so well with Sql Srvr!!!!; but I am brand new to it; just created my first page in WP :)

@klompenrunner
Copy link
Author

The correct fix is as follows:

folder: wp-includes
file: fields_map.parsed_types.php

line 14:
'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 ' =>

misses a closing parenthesis at the end; add one like so:

'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 )' =>

@patrickebates
Copy link
Member

This is interesting. The field map is something unique to each installation. Entries are only recorded in there when translations are required for creating tables for plugins. Never seen a syntax error produced in that file before.

@klompenrunner
Copy link
Author

Your comment is very helpful! So these are the plugins that create this error for me:

  • WP-Optimize (of course, this is very focused on MySQL, and half is not really functional on SQL Server, but it still has some value)
  • Role Scoper
  • Groups
  • Press Permit Core
  • Media Library Assistant

To be honest; the latter four I removed after seeing the error; I found alternative plugins that did not error.

And appropriate or not for an issues list, but: Your Project Nami is AWESOME. Thank you so much for sharing.

@adriandwilliams
Copy link

Warning: preg_replace(): Compilation failed: missing ) at offset 254 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 255 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 256 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 257 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473

1 similar comment
@adriandwilliams
Copy link

Warning: preg_replace(): Compilation failed: missing ) at offset 254 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 255 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 256 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 257 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473

@adriandwilliams
Copy link

I have these errors on some courses I am trying to develop. Is there any reprieve to these problems?

@patrickebates
Copy link
Member

Did these errors begin appearing after installing a new plugin?

@adriandwilliams
Copy link

Warning: preg_replace(): Compilation failed: missing ) at offset 254 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 255 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 256 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 257 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: array_search() expects parameter 2 to be array, null given in D:\home\site\wwwroot\wp-content\plugins\lucidlms\includes\abstracts\abstract-lucid-course-element.php on line 500

@adriandwilliams
Copy link

Those errors began as I was adding courses to LucidLMS Plugin

@adriandwilliams
Copy link

Warning: preg_replace(): Compilation failed: missing ) at offset 254 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 255 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 256 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473 Warning: preg_replace(): Compilation failed: missing ) at offset 257 in D:\home\site\wwwroot\wp-includes\translations.php on line 1473

@patrickebates
Copy link
Member

It would seem that the LucidLMS plugin is the problem, and should be treated as unsupported.

@adriandwilliams
Copy link

Very well do you have a solution? to using an LMS that is supported in this environment?

@patrickebates
Copy link
Member

Haven't had the question come up before. For that matter, I wasn't aware that any LMS plugins existed for WordPress.

I guess you might look for an LMS plugin which doesn't require the creation of database tables. See our statement on Plugin Compatibility for more details.
http://projectnami.org/plugin-compatibility/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants