Page 1 of 1
Problem with sorting articles and structure items
Posted: Mon 3. Apr 2006, 08:25
by Pixelchaos
Hi,
I'm using phpwcms for almost two years now on a fairly big website. It's got about 250 pages and 70 structure items. At the moment I'm running 1.2.5DEV.
The problem is with sorting the articles and structure items. It started with non-admins not being able to move articles or conent parts up or down in a list. Now even as an admin I can't do it. Same goes for the structure items. They move, but totally unpredictable. If I click the small arrow "up" 10 times the structure item goes down 5 times and then up 1 time.
Is there a solution for this problem? Or is my website too big for PHPwcms?
Posted: Mon 3. Apr 2006, 09:55
by pepe
As
workaround, you can
CUT & PASTE the articles

Posted: Thu 6. Apr 2006, 05:13
by StudioZ
Samething here
Wish we can find the problem...
Pretty hard to find this gremlin

Posted: Thu 13. Apr 2006, 23:42
by StudioZ
Customers are back again on me with:
Do you have a solution for this bug?
This is getting pretty annoying

Posted: Thu 13. Apr 2006, 23:55
by DeXXus
Does this mean that any "single" click does not ALWAYS produce the correct direction of movement?
Or only clicks in "rapid" fashion cause improper movements?
Posted: Fri 14. Apr 2006, 02:29
by StudioZ
Hi DeXXus
I mean: 'any "single" click does not ALWAYS produce the correct movement' + on long lists of content parts, then the ones at the bottom get stucked there without the possibility to move them up or down. Also I heard about unpredictable movements (using arrows). I myself seen this behavior but in Admin menu, not in content parts listings.
DeXXus wrote:Does this mean that any "single" click does not ALWAYS produce the correct direction of movement?
Or only clicks in "rapid" fashion cause improper movements?
Cheers,

Posted: Fri 14. Apr 2006, 04:38
by DeXXus
Looks like the author of the javascript corrected a bug:
Download and replace the "original" with the
updated file HERE and give it a go!
http://www.mattkruse.com/javascript/sel ... ource.html
// HISTORY
// ------------------------------------------------------------------
// April 20, 2005: Fixed the removeSelectedOptions() function to
// correctly handle single selects
// June 12, 2003: Modified up and down functions to support more than
// one selected option
/*
Posted: Fri 14. Apr 2006, 05:40
by StudioZ
Thank you DeXXus for that reasearch
Could have had worked but... I gave it a try by swapping my customer's Java Script file: include\inc_js\
selectbox.js
with the one at the link you kindly provided me... still... no success.
Same issue. Won't move Up or Down when in
article information
detailed content parts listing as opposed to the
Article menu: simple content parts listing +
Where in the world did you found this updated Java Script?
Cheers,
Posted: Fri 14. Apr 2006, 06:00
by DeXXus
StudioZ wrote:Where in the world did you found this updated Java Script?
Cheers,
I was looking in the wrong place... OBVIOUSLY...LOL!
I just came across function calls to
moveOptionUp and hunted down the .js file on a "wild goose" chase (musta been Canadian geese.

)
Another "wild guess" is...
It's probably related to the same problem where content parts have the symptom of not showing "preview" snippet in article information screens. Among other people, you reported it here:
http://www.phpwcms.de/forum/viewtopic.php?t=9728
Posted: Fri 14. Apr 2006, 06:14
by StudioZ
hey DeXXus shock:
I found this part in file:
include\inc_tmpl\
articlecontent.list.tmpl.php
I have the feeling that the
Crux of the Biscut -- F.Z. is right there...
Starting at line 174:
Code: Select all
if($sc) {
//Jetzt aufbauen der Sortieranweisung
foreach($sbutton as $key => $value) {
if($key == 1) {
// if 1st content part in list
$sbutton[$key]["top"] = "<img src=\"img/button/sort_top_0.gif\" border=\"0\">";
} elseif(isset($sbutton[$key-1]["block"]) && $sbutton[$key-1]["block"] != $sbutton[$key]["block"]) {
// if this content part is selected for different block than previous
$sbutton[$key]["top"] = "<img src=\"img/button/sort_top_0.gif\" border=\"0\">";
} else {
$sbutton[$key]["top"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
$sbutton[$key]["id"].":".$sbutton[$key-1]["sort"]."|".
$sbutton[$key-1]["id"].":".$sbutton[$key]["sort"].
"\" title=\"".$BL['be_article_cnt_up']."\"><img src=\"img/button/sort_top_1.gif\" border=\"0\"></a>";
}
if($key == $sc) {
// if this is the last content part in list
$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_bottom_0.gif\" border=\"0\">";
} elseif(isset($sbutton[$key+1]["block"]) && $sbutton[$key+1]["block"] != $sbutton[$key]["block"]) {
// if this is the last content part in current block and next is different
$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_bottom_0.gif\" border=\"0\">";
} else {
$sbutton[$key]["bottom"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
$sbutton[$key]["id"].":".$sbutton[$key+1]["sort"]."|".
$sbutton[$key+1]["id"].":".$sbutton[$key]["sort"].
"\" title=\"".$BL['be_article_cnt_down']."\"><img src=\"img/button/sort_bottom_1.gif\" border=\"0\"></a>";
}
$sbutton_string[$sbutton[$key]["id"]] = $sbutton[$key]["top"].
"<img src=\"img/leer.gif\" width=\"1\" height=\"1\">".
$sbutton[$key]["bottom"];
}
unset($sbutton);
}
Cheers,
Posted: Fri 14. Apr 2006, 06:18
by DeXXus
"admin.functions.inc.php" has similar coding logic.
Posted: Fri 14. Apr 2006, 19:08
by StudioZ
well... I guess there's only Oliver to fix this for us....
Must only be a typo somewhere I can't find...

Posted: Tue 18. Apr 2006, 17:38
by Oliver Georgi
I think has nothing to do with typo. The problem might be how the sorting is done. And seems very problematic for all articles and content part created by copy/paste. And also when sorting of articles is not possible for users - check sorting setup in structure editor under admin. Only manual will allow sorting for articles.
I'm willing to edit sorting in another way - what I always tried was to handle all such sorting stuff with minimized SQL queries. But maybe this is not neccessary anymore because all have fast servers.
I will check how to optimize that part of code.
What never help is replacing JS code because this all is done in PHP.
Oliver
Posted: Tue 18. Apr 2006, 18:07
by StudioZ
Hi Oliver

If it can help you...
The place (article information) where I have this problem, the section is set to manual sorting.
Thanks for dropping in,
