• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5514: suppressTWikiSaveValidation and validateTWikiMandatoryFields Javascript errors in IE and Firefox

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   patch 4.2.1

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

-- TWiki:Main/GianJones - 10 Apr 2008

When a page is being edited ('Edit' or 'Raw Edit'):

If I press 'Cancel' I get the following 2 Javascript errors:

  • suppressTWikiSaveValidation is not defined
  • validateTWikiMandatoryFields is not defined

If I press 'Save', 'Quite save' or 'Save and Continue' I get the following Javascript error:

  • validateTWikiMandatoryFields is not defined

This is both in ie6 and firefox 2.0.0.13
The above actions are still carried out when I ignore the errors (in both ie and firefox)

I suspect that these functions being called, are somehow not beeing included (maybe a .js include is missing) from one of your Javascript libaries.

I actually tried this with a basic installation without installing any additional plugins.

This site is running TWiki version TWiki-4.2.0, Tue, 22 Jan 2008, build 16278, Plugin API version 1.2
Server: Redhat Linux enterprise, Apache 1.3 and Perl 5.008005

Even when I updated the TinyMCEPlugin to the latest version (16598) the errors still occure.


In the '/twiki/templates/edit.pattern.tmpl' templates this section appears:

%TMPL:DEF{"script:skintemplate"}%%IF{"not context TinyMCEPluginEnabled or $nowysiwyg='1'" then='$percntTMPL:P{\"script:skintemplate:edit\"}$percnt'}%%TMPL:END%

%TMPL:DEF{"script:skintemplate:edit"}%<script type="text/javascript" src="%PUBURLPATH%/%SYSTEMWEB%/TWikiJavascripts/twikiPref.js"></script><script type="text/javascript" src="%PUBURLPATH%/%SYSTEMWEB%/TWikiJavascripts/twiki_edit.js"></script><script type="text/javascript" src="%PUBURLPATH%/%SYSTEMWEB%/PatternSkin/pattern_edit.js"></script>%TMPL:END%

it does look to me that the IF condition is not being met. Any reason why? I have both the 'WysiwygPlugin' and 'TinyMCEPlugin' enabled in configure?

TWiki:Main.GianJones

I also see JS errors often. Probably in the same situation. Lets us get this fixed in 4.2.1. It cannot be a big deal.

-- TWiki:Main.KennethLavrsen - 10 Apr 2008

The problem is due to the fact that the IF statement you pointed out prevents twiki_edit.js being loaded when Tiny MCE is in use, but the Tiny MCE javascripts call functions from twiki_edit.js

This requires an understanding of why twiki_edit.js is excluded when Tiny MCE is loaded. It may be necessary to split twiki_edit.js so that those functions are loaded unconditionally.

Confirmed.

-- CC - 01 May 2008

We need to get this one moving.

Is the quick fix to copy the missing functions to !/pub/TWiki/TinyMCEPlugin/twiki.js?

In that case - which tool do you use to compress the twiki_src.js into twiki.js?

I have also tried to remove the IF from edit.pattern.tmpl. I have not yet seen any negative effect of this but I have not tested much and I fear a potential problem since in the TWikiJavascripts/twiki_edit.js there are functions with same name as in TinyMCEPlugin/twiki.js. But removing the IF does remove the errors in the browser.

We need to get the urgent bugs resolved now so I am going for the quick fixes now. But I need to know how I should compress the js.

-- TWiki:Main.KennethLavrsen - 17 Jun 2008

Got the answer on IRC

perl build.pl compress is the answer

Will need to test before I check anything in. My plan is to try to copy the missing functions to twiki.js in TMCE plugin. Seems to be the low risk and easy way.

-- KennethLavrsen - 17 Jun 2008

I simply copied the missing functions from from TWikiJavascripts/twiki_edit.js as I found it too risky to always include twiki_edit.js. If someone wants a more elegant solution then go ahead but this bug has been open since April 10 and it was a release blocker for 4.2.1. At least with this the constant errors at the bottom of the browser are gone. Confirmed in IE and FF3. twiki_tiny.js is just re-compressed by build script and only a few spaces are the difference.

I have tested that the mandatory form fields are still checked and that you can cancel out also without mandatory form fields being populated.

Tested in IE and the new FF3.

-- TWiki:Main.KennethLavrsen - 18 Jun 2008

ItemTemplate
Summary suppressTWikiSaveValidation and validateTWikiMandatoryFields Javascript errors in IE and Firefox
ReportedBy TWiki:Main.GianJones
Codebase 4.2.0
SVN Range TWiki-5.0.0, Thu, 03 Apr 2008, build 16612
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:16904 TWikirev:16905
TargetRelease patch
ReleasedIn 4.2.1
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2008-08-04 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback