When I set up the module, I get this error in the settings-

user warning: Table 'themoder_drupaldb.tinymce_settings' doesn't exist query: SELECT * FROM tinymce_settings in /home/themoder/public_html/drupal/includes/database.mysql.inc on line 167.

Any idea the solution?

CommentFileSizeAuthor
#7 tinymce.install.patch3.99 KBkreynen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kreynen’s picture

If you are really using the Drupal 5.x-1.x-dev version of the module, it shouldn't be looking for a table called tinymce_settings.

kreynen’s picture

Assigned: Unassigned » kreynen
Status: Active » Closed (fixed)
nibb’s picture

Im getting the same issue::

user warning: Table 'webdev.durpal5_tinymce_settings' doesn't exist query: SELECT * FROM durpal5_tinymce_settings in /srv/www/htdocs/faq/includes/database.mysql.inc on line 172.

Was working fine until I upgraded. Looks like the tables in plugin_reg.php are not in fact being created.

Can anyone provide an answer?

baloneysammitch’s picture

Why is this closed? I have the same problem and I'm using 5.x-1.x-dev.

kreynen’s picture

Status: Closed (fixed) » Closed (duplicate)

The issue was closed because at the time (during the dark days when TinyMCE had another maintainer) the 5.1 release didn't require additional tables. There was no way the user was using the 5.1 release and getting that error. With the current release, there are issues with TinyMCE not recognizing tables when updating.

CheckeredFlag’s picture

Status: Closed (duplicate) » Active

I downloaded the latest version (updated March 1) and I'm having the same issue. How do I know which version I have? The version I got on Feb 28 is very different but appears to have the same version number: 5.x-1.x-dev. I don't get it.... (Sorry, I'm very new at all this.)

Anyway, if I understand your statement correctly, you're saying that there was a period when these tables were NOT needed, but now they are required. Correct?

If so, then, I noticed a MySQL bug in tinymce.install:

      db_query("CREATE TABLE {tinymce_settings} (
                name varchar(128) NOT NULL default '',
                settings text NOT NULL default '',
                PRIMARY KEY (name)
               ) /*!40100 DEFAULT CHARACTER SET utf8 */;");

MySQL states that text and blob columns CANNOT have a default value:
http://dev.mysql.com/doc/refman/5.0/en/blob.html

Therefore, it should be this instead:

      db_query("CREATE TABLE {tinymce_settings} (
                name varchar(128) NOT NULL default '',
                settings text NOT NULL,
                PRIMARY KEY (name)
               ) /*!40100 DEFAULT CHARACTER SET utf8 */;");

In newer versions, this is now considered an error and no longer just a warning when in strict mode, which will prevent this table from being created during the installation.

Hope this helps....

Marco

kreynen’s picture

Status: Active » Needs review
FileSize
3.99 KB

I've created this patch for the install file with the changes mmoreno suggested as well as the first attempt to address the issues with the early versions of TinyMCE that didn't require the tinymce_settings and tinymce_roles tabels. This patch adds an uninstall option as well an update that creates the tables if you run (http://www.yoursite.com/drupal5/update.php). I've tested it a few times on my installs going from the previous version of 5.1 to the current version and it worked fine, but I'd like some feedback before committing it.

I had to remove the..

function tinymce_update_1() {
return _system_update_utf8(array('tinymce_settings', 'tinymce_role'));
}

I'm not sure how to add an "if exists" to utf8 update. Anyone?

I also haven't includes anything to deal with the issue of the Moxie module renaming the TinyMCE tables.

CheckeredFlag’s picture

Thanks for the quick fix! I noticed a couple things:

- You made changes for both MySQL as well as PostgreSQL. Not being familiar with PostgreSQL, I don't know whether removing the default for it is needed...or even wise. Someone knowledgeable in PostgreSQL would need to address this.

- Not sure why you cloned the code for 'mysql' and mysqli' in the switch statement, but this seems redundant and inconsistent with how it is done with other core modules. I'd suggest reverting to the previous format of having the two case statements back to back. (Either "case" will execute the code that follows until it reaches a "break".)

Not sure what you mean by the utf8 update comment. Is this an sql or drupal thing? Can't help you if it refers to the drupal api...still a newbie.

Marco

kreynen’s picture

Yeah. I didn't expand those as far as I thought I would. I was hoping to add SQL for checking for Moxie tables and copying the data from those if they existed. I thought that would require a different syntax between mysql and mysqli.

If you look at Nedjo's patches, he's added updates to the .install as well. Before we release 5.2, I really want to have a universal .install that allows everyone (Drupal-id 5.1, Moxie, and 4.7 users) to upgrade without an error.

The utf8 was the first update that was attempted in the previous install. Since the tables that are trying to be updated don't always exist, this generates an error.

greeneo’s picture

Sorry, newb question, how do you get this patch to work? Replace the old .install file with it?

kreynen’s picture

See the Drupal Handbook section on Patches. Learning to apply patches is going to be REALLY helpful if you are going to continue using Drupal.

Furayo’s picture

Does this work in Windows? I do not think so....

kreynen’s picture

The patch for an install problem has nothing to do with what operating system you use. Here is a list of the browsers TinyMCE currently works with.

CheckeredFlag’s picture

You'll need a 'patch' application. While it had its origins in the Unix world, you can get patch for Windows.

Just be sure to first convert the line endings of the patch file from Unix format to Windows. Simplest way without installing any new software is to use Wordpad (not Notepad) to open the file and then Save As to a new text file. Then use Notepad to ensure the new file looks it did in Wordpad (no black boxes).

andrewfn’s picture

The patch worked perfectly for me. I was able to uninstall the old (bad) TinyMCE and install the latest one and all the table warnings have gone away! Thanks!

Drupalace-1’s picture

I've gotten this exact same error, and am eager to try the patch or other solutions. But before I muck with anything, there's one puzzling thing:

I run several sites off of the same Drupal installation, and thus off the same TinyMCE module. If the problem is in the module itself, and not in a site DB, why in the world do I get the error message for *one* site, while other sites run TinyMCE just fine? They're all using the same module installation... (I've run update.php for all, too.)

If anyone has an insight into this oddity, please do tell!

m3avrck’s picture

Status: Needs review » Fixed

This has been fixed.

1. The SQL for creating the tables was WRONG and has been fixed. No updates are needed because if you got TinyMCE working, then removing that default '' won't make a difference.

2. Add a hook_uninstall

Anonymous’s picture

Status: Fixed » Closed (fixed)
Anonymous’s picture

Title: Installation Issue » Pacthing failed on OSX with terminal

Hi,

Sorry to reopen this topic, but trying to patch on mac osx with terminal and getting these errors:

SSSSSSS:~/desktop/patch SSSSSSS$ patch < tinymce.install.patch.txt
patching file tinymce.install
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 12.
Hunk #3 FAILED at 44.
Hunk #4 FAILED at 57.
4 out of 4 hunks FAILED -- saving rejects to file tinymce.install.rej

both the install.tinymce and patch in the same patch folder.
The install.tinymce file come from the 5.x-1.x dev download.

Done it twice wth the same results.

Any idea what is wrong?
thanks.