Item10555: Unnable to login with hijax.js

pencil
Priority: Normal
Current State: Waiting for Feedback
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: HijaxPlugin
Branches:
Reported By: StefanosKouzof
Waiting For: DavidPatterson
Last Change By: StefanosKouzof
In installations using Foswiki 1.0.9, NatSkin and FullCalendarPlugin, I found that it is nearly impossible to login to Foswiki when using the Hijax plugin (required by FullCalendar).

When trying to login, after entering username and password if I click on the "Login" button, the username and password is cleared and nothing happens. This happens in ALL browsers. However, if you use Firefox and instead of clicking on "Login" you just press while still in the password entry field, the login is completed.

When using IE, the following error is reported:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Wed, 23 Mar 2011 13:43:51 UTC

Message: The object does not support this property or method Line: 746 Character: 2 Code: 0 URI: http://foswiki.local/pub/System/HijaxPlugin/hijax.js

Firebug reports: foswiki.HijaxPluginConfigurableInit is not a function [Break on this error] foswiki.HijaxPlugin.init(foswiki.HijaxPluginConfigurableInit());

The closest bug report I could find is this: http://foswiki.org/Tasks/Item9589

Here are the Installed Plugins:
This site is running Foswiki version Foswiki-1.0.9, Sun, 17 Jan 2010, build 6075, Plugin API version 2.0

Here is a list of the plugins currently installed and enabled on this Foswiki site:

  • FormQueryPlugin (17 Nov 2009, $Rev: 5542 (2009-11-17) $): Provides query capabilities across a database defined using forms and embedded tables in Foswiki topics.
  • TWikiCompatibilityPlugin (Foswiki-1.0.9, $Rev: 6017 (2010-01-11) $): add TWiki personality to Foswiki
  • SpreadSheetPlugin (10 Nov 2009, $Rev: 5484 (2009-11-10) $): Add spreadsheet calculations like "$SUM($ABOVE())" to Foswiki tables and other topic text
  • CommentPlugin (12 Sep 2009, $Rev: 4843 (2009-09-11) $): Quickly post comments to a page without an edit/preview/save cycle
  • ActionTrackerPlugin (04 Nov 2010, $Rev: 9844 (2010-11-04) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachContentPlugin (2.3.3, $Rev: 8629 (2010-08-21) $): Saves dynamic topic text to an attachment
  • AttachmentListPlugin (1.3.4, $Rev: 10310 (2010-12-14) $): Displays a formattable list of topic attachments - from any topic - anywhere in a topic
  • AutoViewTemplatePlugin (2010-07-31, $Rev: 8365 (2010-07-31) $): Automatically sets VIEW_TEMPLATE and EDIT_TEMPLATE
  • BreadCrumbsPlugin (v2.42, $Rev: 4694 (2009-08-20) $): A flexible way to display breadcrumbs navigation
  • ChartPlugin (13 Mar 2010, $Rev: 6743 (2010-03-14) $): Create PNG or GIF charts to visualize Foswiki tables
  • ChecklistPlugin (Cairo, Dakar, Edinburgh, ..., $Rev: 5335 (2009-10-21) $): Create simple checklists.
  • ChecklistTablePlugin (v1.006, $Rev: 3903 (2009-05-14) $): Create a checklist table
  • CompareRevisionsAddonPlugin (21 Oct 2010, $Rev: 9660 (2010-10-21) $):
  • DBCachePlugin (3.40, $Rev: 6290 (2010-02-12) $): Lightweighted frontend to the DBCacheContrib
  • EditChapterPlugin (2.13, $Rev: 10120 (2010-11-30) $): An easy sectional edit facility
  • EditRowPlugin ($Date: 2011/04/04 08:16:33 $, $Rev: 2665 (24 Feb 2009) $): Inline edit for tables
  • EditTablePlugin (4.34, $Rev: 5854 (2009-12-23) $): Edit tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (2.03, $Rev: 8284 (2010-07-23) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.51, $Rev: 5698 (2009-12-02) $): Flexible way to display hierarchical weblists
  • FormPlugin (1.6.2, $Rev: 7602 (2010-05-31) $):
  • FullCalendarPlugin (1.0, $Rev: 8457 (2010-08-11) $): Web 2.0 calendar app
  • GluePlugin (2.20, $Rev: 4420 (2009-07-03) $): Enable markup to span multiple lines
  • HijaxPlugin (1.2, $Rev: 8534 (2010-08-18) $): AJAX integration
  • HistoryPlugin (1.6, $Rev: 8367 (2010-07-31) $): Shows a complete history of a document
  • HomePagePlugin ($Date: 2011/04/04 08:16:33 $, 1340): Allow User specified home pages - on login
  • IfDefinedPlugin (v2.00, $Rev: 4422 (2009-07-03) $): Render content conditionally
  • ImagePlugin (2.31, $Rev: 6307 (2010-02-12) $): Control the display and alignment of images using an easy syntax
  • InterwikiPlugin (20 Sep 2009, $Rev: 5022 (2009-09-20) $): Link ExternalSite?:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (3.75, $Rev: 20090710 (2010-08-18) $): jQuery JavaScript library for Foswiki
  • NatEditPlugin (v4.21, $Rev: 6336 (2010-02-15) $): A Wikiwyg Editor
  • NatSkinPlugin (3.96, $Rev: 6287 (2010-02-12) $): Theming engine for NatSkin
  • ObjectPlugin (1.01, $Rev: 8478 (2010-08-12) $): Use a topic as an Object store.
  • PreferencesPlugin (20 Sep 2009, $Rev: 5037 (2009-09-20) $): Allows editing of preferences using fields predefined in a form
  • RenderListPlugin (2.2, $Rev: 5042 (2009-09-20) $): Render bullet lists in a variety of formats
  • RenderPlugin (3.0, $Rev: 4818 (2009-09-09) $): Render WikiApplications asynchronously
  • RevCommentPlugin (22 Jan 2009, $Rev: 2125 (22 Jan 2009) $): Allows a short summary of changes to be entered for a new revision.
  • SetVariablePlugin (1.02, $Rev: 4287 (2009-06-23) $): Flexible handling of topic variables
  • SlideShowPlugin (02 Aug 2008, $Rev: 2742 (2009-02-26) $): Create web based presentations based on topics with headings.
  • SmiliesPlugin (20 Sep 2009, $Rev: 5046 (2009-09-20) $): Render smilies like smile as icons
  • SubscribePlugin (03 Dec 2008, $Rev: 13787 (18 May 2007) $): Subscribe to web notification
  • TablePlugin (1.044, $Rev: 5755 (2009-12-08) $): Control attributes of tables and sorting of table columns
  • TinyMCEPlugin (29 Dec 2009, $Rev: 5860 (2009-12-28) $): Integration of the Tiny MCE WYSIWYG Editor
  • TopicCreatePlugin (1.4, $Rev: 8161 (2010-07-13) $): Automatically create a set of topics and attachments at topic save time
  • TopicDataHelperPlugin (1.1.2, $Rev: 7039 (2010-04-01) $): helper plugin for collecting, filtering and sorting data objects
  • TreeBrowserPlugin (v2.0, $Rev: 5479 (2009-11-10) $): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.9.1, $Rev: 6156 (2010-01-27) $): Renders topics' parent-child relationships as hierarchical tree view. Useful for dynamic site maps and threads.
  • TwistyPlugin (1.5.4, $Rev: 6281 (2010-02-12) $): Twisty section Javascript library to open/close content dynamically
  • UploadPlugin (1.11, $Rev: 4414 (2009-07-03) $): Attach multiple files to a topic in one go
  • WorkflowPlugin (1.12.1, $Rev: 10878 (2011-03-01) $): Associate a "state" with a topic and then control the work flow that the topic progresses through as content is added.
  • WysiwygPlugin (17 Jan 2010, $Rev: 6068 (2010-01-17) $): Translator framework for Wysiwyg editors
  • ZonePlugin (3.1, $Rev: 9442 (2010-09-30) $): Gather content of a page in named zones while rendering it

No errors are reported in either Apache or Foswiki logs. Any suggestions;

Stefanos Kouzof

-- StefanosKouzof - 28 Mar 2011

Stefanos, I don't have NatSkin installed, please attach the page source (Ctrl+U in FF) to this page. HijaxPluginConfigurableInit should be added to the script zone in the head . Thanks.

And are there any other warnings / odd behaviour once logged in?

-- DavidPatterson - 28 Mar 2011

No, nothing. All works fine. Really nice plugin, BTW smile

-- StefanosKouzof - 28 Mar 2011

You should be seeing something like this
<script type="text/javascript">
(function($) {
if (foswiki.HijaxPluginConfigurableInit == undefined) {
   foswiki.HijaxPluginConfigurableInit = function() {
      var menu = '<div id="hpmenu" class="hpmenu hidden rounded shadow"><ul><li id="hppreviewli"><a class="hpmenulink" url="http://192.168.150.129/newwiki/bin/view/$web/$topic">\
<img alt="preview" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/eye.png" title="Preview this page" /></a></li>\
<li><a class="hpmenulink" url="http://192.168.150.129/newwiki/bin/edit/$web/$topic?nowysiwyg=1">\
<img alt="edit" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/page_edit.png" title="Edit this page" /></a></li>\
<li><a class="hpmenulink" url="http://192.168.150.129/newwiki/bin/view/$web/$topic?raw=on">\
<img alt="raw" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/page_code.png" title="Raw view this page" /></a></li>\
<li><a class="hpmenulink" url="http://192.168.150.129/newwiki/bin/oops/$web/$topic?template=oopshistory">\
<img alt="history" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/page_white_stack.png" title="Inspect the History of this page" /></a></li>\
<li><a class="hpmenulink" url="http://192.168.150.129/newwiki/bin/view/$web/WebCreateNewTopic?topicparent=$topic">\
<img alt="new" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/page_add.png" title="Create a new child of this page" /></a></li></ul></div>\
<div id="hpanchor" class="hidden rounded"><img alt="M" src="http://192.168.150.129/newwiki/pub/System/FamFamFamSilkIcons/anchor.png" /></div>';
      $(menu).appendTo('body');
      return {nohijax:'.nohijax', hps:'$("body *").not(".nossleight")'};
   };
}
}(jQuery));
</script>
in the source just above the inclusion of json.js. It happens in the same Func::addToZone call and, anyway, you seem to be seeing it's effects elsewhere (the anchor appearing to the left of each link when you hover over it?).

Hmmm, OK, I'll install NatSkin.

-- DavidPatterson - 28 Mar 2011

NatSkin installed as well as its dependencies but I can't reproduce the problem. Anything else you can add to the problem report?

-- DavidPatterson - 30 Mar 2011

I can't seem to find this javascript in the login page. Did you also downgraded DBCachePlugin to previous version, as with the instructions on the top of NatSkin ?

-- StefanosKouzof - 31 Mar 2011

No, I've got rev 6290 the same as you.

Add this line to HijaxPlugin.pm in the lib/Foswiki/Plugins directory, in the addDefaultsToPage function just after $configurableInit is defined (around line 67). Then call up the login page and see what's in the debug file in working/logs
Foswiki::Func::writeDebug("HijaxPlugin configurableInit: $configurableInit");

-- DavidPatterson - 31 Mar 2011

The debug file (it's in /data) has empty entries when trying to login by pressing the login button:
| 2011-03-31T13:19:16Z debug | HijaxPlugin configurableInit::   |
On the other hand, if I press 'enter' in the password field, i log in and the debug log contains this entry:
| 2011-03-31T13:15:48Z debug | HijaxPlugin configurableInit:: 
<script type="text/javascript">
(function($) {
if (foswiki.HijaxPluginConfigurableInit == undefined) {
   foswiki.HijaxPluginConfigurableInit = function() {
      var menu = '<div id="hpmenu" class="hidden rounded shadow"><ul></ul></div>\
<div id="hpanchor" class="hidden rounded"><img alt="M" src="%PUBURL%/%SYSTEMWEB%/FamFamFamSilkIcons/link.png" /></div>';
      $(menu).appendTo('body');
      return {nohijax:'.nohijax', hps:'$("body *").not(".nossleight")'};
   };
}
}(jQuery));
</script>
 |

-- StefanosKouzof - 31 Mar 2011

It looks like you've customised the hijax menu by removing all its entries. Is that correct? If so, can you attach the UserHijaxTemplate file? I wonder if it's a contributing factor.

If I understand correctly, when you go to the login page, the following lines aren't producing what they should
my $templates = Foswiki::Func::loadTemplate( 'HijaxPlugin' );
my $configurableInit = Foswiki::Func::expandTemplate( 'hp_configurable_init' );

-- DavidPatterson - 31 Mar 2011

We did not customize anything on the hijax manu. We had to install it as a pre-requisite of ObjectPlugin, which itself is a pre-requisite for FullCalendarPlugin. By the way, we do not have PatternSkin, it is NatSkin - only (Set Skin = nat), because of some conflicts with PatternSkin.

-- StefanosKouzof - 04 Apr 2011
 

ItemTemplate edit

Summary Unnable to login with hijax.js
ReportedBy StefanosKouzof
Codebase 1.0.9
SVN Range
AppliesTo Extension
Component HijaxPlugin
Priority Normal
CurrentState Waiting for Feedback
WaitingFor DavidPatterson
Checkins
TargetRelease n/a
ReleasedIn n/a
I Attachment Action Size Date Who Comment
InstalledPlugins.txttxt InstalledPlugins.txt manage 12 K 28 Mar 2011 - 12:31 StefanosKouzof Source of Login page where the hijax.js error occurs
Topic revision: r10 - 04 Apr 2011, StefanosKouzof
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy