CMS MADE SIMPLE FORGE

Gallery

 

[#5309] cmsms 1.8.2: the ajax sort does not work

avatar
Created By: Juergen Turek (jokkmac)
Date Submitted: Tue Aug 17 18:28:42 -0400 2010

Assigned To: Jos (josvd)
Version: 1.3.2
CMSMS Version: None
Severity: Minor
Resolution: Fixed
State: Closed
Summary:
cmsms 1.8.2: the ajax sort does not work
Detailed Description:
With version 1.8.2 CMSMS does not work the sort with ajax in a gallery.
Even with SVN revision 120 does not


History

Comments
avatar
Date: 2010-08-18 03:54
Posted By: Jos (josvd)

strange, it works for me.

Can you give more details what you do and what exacly does and does not work?

There is no Ajax involved by the way. You have to click the save button after
you're done with sorting the images.
      
avatar
Date: 2010-08-19 09:30
Posted By: Juergen Turek (jokkmac)

sorry, i ment the nice "drag&drop" function and not ajax.
i have tested with gallery 1.3.2 and 1.4.
what i do?
- i sort 5 pictures in a gallery (the second to the last for example) and press
the "save" button, but
- nothing happens: you see the old sorting of images

on the same server i have two installs of cmsms:
1. 1.8.1 basic with german language-pack
-> sorting is okay
2. 1.8.2 basic with german language-pack
-> no change in sorting

here look at the debug-output:
cmsms1.8.1 base with german language-pack with module gallery:
Debug: (0,353346) - (11773656)
(mysql): SELECT fieldid FROM cms_module_gallery_fielddefs WHERE public <>
1
Debug: (0,353622) - (11777472)
(mysql): UPDATE cms_module_gallery_props SET templateid='7',hideparentlink=1
WHERE fileid='1'
Debug: (0,353963) - (11778352)
(mysql): UPDATE cms_module_gallery SET title='', comment='', fileorder=1 WHERE
fileid = 7
Debug: (0,354237) - (11778660)
(mysql): UPDATE cms_module_gallery SET title='', comment='', fileorder=2 WHERE
fileid = 5
Debug: (0,354521) - (11779220)
(mysql): UPDATE cms_module_gallery SET title='', comment='', fileorder=3 WHERE
fileid = 8
Debug: (0,354804) - (11779636)
(mysql): UPDATE cms_module_gallery SET title='', comment='', fileorder=4 WHERE
fileid = 6
Debug: (0,355064) - (11780056)
(mysql): UPDATE cms_module_gallery SET title='', comment='', fileorder=5 WHERE
fileid = 4
Debug: (0,355246) - (11778440)
(mysql): SELECT value FROM cms_module_gallery_fieldvals WHERE fileid IN(5,6,4)

cmsms1.8.2 base with german language-pack with module gallery:
Debug: (0,350518) - (11776852)
(mysql): SELECT fieldid FROM cms_module_gallery_fielddefs WHERE public <>
1
Debug: (0,350792) - (11780728)
(mysql): UPDATE cms_module_gallery_props SET templateid='7',hideparentlink=1
WHERE fileid='1'
Debug: (0,351043) - (11780712)
(mysql): UPDATE cms_module_gallery SET title='', comment='' WHERE fileid = 7
Debug: (0,351285) - (11781260)
(mysql): UPDATE cms_module_gallery SET title='', comment='' WHERE fileid = 5
Debug: (0,351525) - (11781584)
(mysql): UPDATE cms_module_gallery SET title='', comment='' WHERE fileid = 8
Debug: (0,351763) - (11781968)
(mysql): UPDATE cms_module_gallery SET title='', comment='' WHERE fileid = 6
Debug: (0,352021) - (11782388)
(mysql): UPDATE cms_module_gallery SET title='', comment='' WHERE fileid = 4
Debug: (0,352199) - (11781000)
(mysql): SELECT value FROM cms_module_gallery_fieldvals WHERE fileid IN(5,6,4)

=> in 1.8.2 there is no "fileorder" after the "comment"
if i go back from 1.8.2 to 1.8.1: sorting is okay again.
i think, it's a bug in 1.8.2?

Thanks for your brilliant module :-)
      
avatar
Date: 2010-08-20 06:45
Posted By: Jos (josvd)

Thanks for your decent testreport.

Turned out I was testing on 1.8.1 after all... On another 1.8.2 install I see
the same issue.

Thanks to your testreport I also found the cause. 
The function CreateInputHidden didn't provide an id in the html output, so I
added this manually with 'id="sort"' as an extra parameter.

Aparently this is fixed in 1.8.2, but the id now has a trailing module-id. 

To solve this in a version independant way, you have to make two changes in the
code:

in action.editgallery.php
change: $smarty->assign('hidden', $this->CreateInputHidden($id, 'sort', '',
'id="sort"'));
to: $smarty->assign('hidden', '<div class="hidden" id="sort">' .
$this->CreateInputHidden($id, 'sort', '') . '</div>');

and in module.Gallery.php
change: $('#sort').val(sortstr);
to: $('#sort input').val(sortstr);

      
avatar
Date: 2010-08-30 15:33
Posted By: Jos (josvd)

fixed in Gallery version 1.4.1
      
Updates

Updated: 2010-08-30 15:33
resolution_id: 6 => 7
state: Open => Closed

Updated: 2010-08-20 06:45
resolution_id: 10 => 6

Updated: 2010-08-18 03:54
resolution_id: => 10