I tested this on the release branch when I committed it to the trunk and
I couldn't reproduce the bug this fixes so I didn't apply it to the release branch. I'm guessing the underlying change that caused the bug was introduced after the branch so this should be reverted as the release branch now has the wrong page details for search results. Ray [hidden email] wrote: > Author: lektran > Date: Wed Jun 6 02:38:24 2007 > New Revision: 544779 > > URL: http://svn.apache.org/viewvc?view=rev&rev=544779 > Log: > Applied fix from trunk for revision: 544429 > > Modified: > ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > > Modified: ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl?view=diff&rev=544779&r1=544778&r2=544779 > ============================================================================== > --- ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl (original) > +++ ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl Wed Jun 6 02:38:24 2007 > @@ -31,23 +31,23 @@ > <#if productIds?has_content> > <div class="product-prevnext"> > <#-- Start Page Select Drop-Down --> > - <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)> > + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> > <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;"> > - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> > - <#list 1..viewIndexMax as curViewNum> > - <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option> > + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> > + <#list 0..viewIndexMax as curViewNum> > + <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> > </#list> > </select> > <#-- End Page Select Drop-Down --> > <b> > - <#if 0 < viewIndex?int> > - <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | > + <#if (viewIndex?int > 0)> > + <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | > </#if> > - <#if 0 < listSize?int> > + <#if (listSize?int > 0)> > <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> > </#if> > <#if highIndex?int < listSize?int> > - | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> > + | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> > </#if> > </b> > </div> > @@ -66,23 +66,23 @@ > <#if productIds?has_content> > <div class="product-prevnext"> > <#-- Start Page Select Drop-Down --> > - <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)> > + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize - 1)?double / viewSize?double)> > <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;"> > - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> > - <#list 1..viewIndexMax as curViewNum> > - <option value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum}</option> > + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> > + <#list 0..viewIndexMax as curViewNum> > + <option value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> > </#list> > </select> > <#-- End Page Select Drop-Down --> > <b> > - <#if 0 < viewIndex?int> > - <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | > + <#if (viewIndex?int > 0)> > + <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonPrevious}</a> | > </#if> > - <#if 0 < listSize?int> > + <#if (listSize?int > 0)> > <span class="tabletext">${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}</span> > </#if> > <#if highIndex?int < listSize?int> > - | <a href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> > + | <a href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonNext}</a> > </#if> > </b> > </div> > > > > |
Hi Ray
Thanks for the info, I'll revert it tonight. I have to admit I didn't test for the bug first, I checked the svn history for the changed file and it hadn't been changed since January, so I assumed it was an existing bug. As a side note, since most committers aren't bothering (or don't have time) to commit fixes to the release branch, if anyone knows that a fix should (but don't have time) or shouldn't go into 4.0 please comment as such in either the commit or the dev list so that I don't have to try and figure it out myself. Thanks Scott On 12/06/07, Ray Barlow <[hidden email]> wrote: > > I tested this on the release branch when I committed it to the trunk and > I couldn't reproduce the bug this fixes so I didn't apply it to the > release branch. I'm guessing the underlying change that caused the bug > was introduced after the branch so this should be reverted as the > release branch now has the wrong page details for search results. > > Ray > > > [hidden email] wrote: > > Author: lektran > > Date: Wed Jun 6 02:38:24 2007 > > New Revision: 544779 > > > > URL: http://svn.apache.org/viewvc?view=rev&rev=544779 > > Log: > > Applied fix from trunk for revision: 544429 > > > > Modified: > > > ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > > > > Modified: > ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > > URL: > http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl?view=diff&rev=544779&r1=544778&r2=544779 > > > ============================================================================== > > --- > ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > (original) > > +++ > ofbiz/branches/release4.0/applications/order/webapp/ordermgr/entry/catalog/keywordsearch.ftl > Wed Jun 6 02:38:24 2007 > > @@ -31,23 +31,23 @@ > > <#if productIds?has_content> > > <div class="product-prevnext"> > > <#-- Start Page Select Drop-Down --> > > - <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double > / viewSize?double)> > > + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize > - 1)?double / viewSize?double)> > > <select name="pageSelect" class="selectBox" onchange=" > window.location=this[this.selectedIndex].value;"> > > - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + > 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> > > - <#list 1..viewIndexMax as curViewNum> > > - <option > value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - > 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${ > uiLabelMap.CommonGotoPage} ${curViewNum}</option> > > + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + > 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> > > + <#list 0..viewIndexMax as curViewNum> > > + <option > value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${ > uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> > > </#list> > > </select> > > <#-- End Page Select Drop-Down --> > > <b> > > - <#if 0 < viewIndex?int> > > - <a > href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonPrevious}</a> | > > + <#if (viewIndex?int > 0)> > > + <a > href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int > - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${ > uiLabelMap.CommonPrevious}</a> | > > </#if> > > - <#if 0 < listSize?int> > > + <#if (listSize?int > 0)> > > <span class="tabletext">${lowIndex+1} - ${highIndex} ${ > uiLabelMap.CommonOf} ${listSize}</span> > > </#if> > > <#if highIndex?int < listSize?int> > > - | <a > href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonNext}</a> > > + | <a > href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonNext}</a> > > </#if> > > </b> > > </div> > > @@ -66,23 +66,23 @@ > > <#if productIds?has_content> > > <div class="product-prevnext"> > > <#-- Start Page Select Drop-Down --> > > - <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double > / viewSize?double)> > > + <#assign viewIndexMax = Static["java.lang.Math"].ceil((listSize > - 1)?double / viewSize?double)> > > <select name="pageSelect" class="selectBox" onchange=" > window.location=this[this.selectedIndex].value;"> > > - <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + > 1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option> > > - <#list 1..viewIndexMax as curViewNum> > > - <option > value="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${curViewNum?int - > 1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>">${ > uiLabelMap.CommonGotoPage} ${curViewNum}</option> > > + <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int + > 1} ${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option> > > + <#list 0..viewIndexMax as curViewNum> > > + <option > value="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${curViewNum?int}/~clearSearch=N</@ofbizUrl>">${ > uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option> > > </#list> > > </select> > > <#-- End Page Select Drop-Down --> > > <b> > > - <#if 0 < viewIndex?int> > > - <a > href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonPrevious}</a> | > > + <#if (viewIndex?int > 0)> > > + <a > href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int > - 1}/~clearSearch=N</@ofbizUrl>" class="buttontext">${ > uiLabelMap.CommonPrevious}</a> | > > </#if> > > - <#if 0 < listSize?int> > > + <#if (listSize?int > 0)> > > <span class="tabletext">${lowIndex+1} - ${highIndex} ${ > uiLabelMap.CommonOf} ${listSize}</span> > > </#if> > > <#if highIndex?int < listSize?int> > > - | <a > href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonNext}</a> > > + | <a > href="<@ofbizUrl>keywordsearch/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex+1}/~clearSearch=N</@ofbizUrl>" > class="buttontext">${uiLabelMap.CommonNext}</a> > > </#if> > > </b> > > </div> > > > > > > > > > |
Free forum by Nabble | Edit this page |