Results 1 to 1 of 1
Oct 2, 2011, 16:56 #1
- Join Date
- Oct 2011
- 0 Post(s)
- 0 Thread(s)
bug in js using temp.join, to be corrected
I have a problem due to a bug found in a js used by a Joomla component (Alberghi), now virtually abandoned.
unfortunately, this component is the main one in a site I made time ago for a Tour Operator, with some workaround I created to better satisfy the specific needs of a Tour Operator, managing tour-packets, vs. a simple Hotel.
this is the code:
I guess the developers didn't test the script in a running site, as the problem was not found at the beginning, with the first creation of the packet items: the problem arises when editing/updating an existing packet provided of an existing image list.
at each further saving, the image list is modified by adding a new blank row, thus creating a mess on the output page, where the blank rows are read as missing images, showing the <alt="click to zoom", instead of a regular column of thumbnails.
I found that the problem is given by the code temp.join( '\n' ), so I changed it in temp.join( ' ' ): the existing file lists are no more filled in by blank rows, but is not possible to get a proper list with a new packet, as the image names are not placed in a stacked list (no way to see them, later, in the newly generated page).
my so poor knowledge of JavaScrpt prevents me to find out a workaround (I know just a little PHP) either to make the script sensitive to an existing file list, without the blank row insertion, or to find out a wiser way to create one-shot only new rows.
thanks in advance for any hint or suggestion that could help me in solving this embarrassing flaw of the original script.