Opened 11 years ago

Closed 10 years ago

#1492 closed defect (fixed)

Linker button sometimes does not work for different image paths

Reported by: guest Owned by:
Priority: normal Milestone: 0.96
Component: Plugins Version: trunk
Severity: normal Keywords: Linker bug
Cc: dobrivecher@…


I customized $dir and $url in /xihna/plugins/Linker/scan.php for each user to have his/her own area and found that for some directories Linker works finely, but for some directories, not finely. (I tested it in Firefox 3.5.7).
For example, when scan.php produced [ { url: '/p8', children: [ { url: '/p8/images', children: [ { url: '/p8/images/plan.txt' } ] } ] }, { url: '/2_1Made_in_America.doc' } ]
the Linker worked well, but when scan.php produced
[ { url: '/images', children: [ { url: '/images/plan.txt' } ] } ]
the Linker did not work well.
Firebug told that the problem is Unhandled exception in xihna/plugins/Linker/dTree/dtree.js.
I investigated this case and found that the actual error is in
xihna/plugins/Linker/pluginMethods.js in function
makeNodes. I corrected this bug and attached the corrected file since other users can meet this problem too.
Best regards,
Volodymyr Dobryvechir (dobrivecher at yahoo dot com)

Attachments (1)

pluginMethods.js (9.7 KB) - added by guest 11 years ago.
file xihna/plugins/Linker/pluginMethods.js where the bug was fixed

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by guest

file xihna/plugins/Linker/pluginMethods.js where the bug was fixed

comment:1 Changed 11 years ago by gogo

  • Cc dobrivecher@… added

Volodymyr, could you please say which changes are required to the uncompressed file, you have only provided the compressed file.

Here is the uncompressed file in the current trunk:


comment:2 Changed 11 years ago by guest

Dear Gogo,

Changes should be made in module /xihna/plugins/Linker/pluginMethods.js as follows:

  1. Line 362: this.dTree.add(Linker.nxtid++, parent,

must be replaced with

this.dTree.add(this.Dialog_nxtid++, parent,

  1. Line 378: var id = Linker.nxtid++;

must be replaced with

var id = this.Dialog_nxtid++;

or for the optimization you can do the same by removing lines 375,377,378,379


  1. Linker.nxtid is never used in the whole Xinha project except in this function (Linker.Dialog.prototype.makeNodes)
  2. Linker.nxtid is never initialized and when it is used for the first time, it has a value of 'undefined'
  3. Even if you insert the initialization of Linker.nxtid, it is not correct to use it at all

because every new item in dTree must have a unique id disregarding it is a node with children or without children. For this purpose the use of additional counter is wrong.
(We have already a counter of ids, this.Dialog_nxtid and the use of any other counter is
not logical).

  1. Final argument: with these changes it works fine, the old version sometimes threw

unhandled exception and Linker menu did not appear at all.

Best regards,
Volodymyr Dobryvechir (dobrivecher at yahoo dot com
P.S. Believe in Jesus Christ and follow Him, then you will be saved from the eternal punishment in the fire lake and will have the eternal life.

comment:3 Changed 10 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Committed in changeset:1257 thanks for your contribution.

Note: See TracTickets for help on using tickets.