diff --git a/last_commit.txt b/last_commit.txt index 65a1cc3f03..82a86c0efd 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,188 +1,104 @@ -Repository: plone.app.contenttypes +Repository: plone.formwidget.recurrence Branch: refs/heads/master -Date: 2015-11-26T14:04:04+01:00 -Author: Gil Forcada Codinachs (gforcada) -Commit: https://github.com/plone/plone.app.contenttypes/commit/d524d905295acbcc0825b17b74dac25458cd5586 +Date: 2015-11-18T11:01:12+01:00 +Author: Julian Handl (julianhandl) +Commit: https://github.com/plone/plone.formwidget.recurrence/commit/b6f08e9e71d4fc1b041265bf9f25e7dda6bafe79 -Remove outdated script - -I guess that this script is already useless given plone.recipe.codeanalysis +Fix index out of range bug for current batch Files changed: -D templates/code-analysis.sh - -diff --git a/templates/code-analysis.sh b/templates/code-analysis.sh -deleted file mode 100644 -index b12e822..0000000 ---- a/templates/code-analysis.sh -+++ /dev/null -@@ -1,53 +0,0 @@ --#!/bin/bash --RESTORE='\033[0m' --RED='\033[00;31m' --GREEN='\033[00;32m' -- --title="${options['title']}" -- --function check { -- command -v ${options.get('check', '')} >/dev/null 2>&1 || { -- echo -ne $$title -- #echo >&2 "${options.get('check', '')} not installed!"; -- len=$${#title} -- gap=$$((18-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ \033[00;33mSKIP\033[0m ]" -- exit 1; -- } --} -- --function success { -- echo -ne $$title -- len=$${#title} -- gap=$$((20-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ \033[00;32mOK\033[0m ]" --} -- --function failure { -- echo -ne $$title -- len=$${#title} -- gap=$$((15-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ $${RED}FAILURE$${RESTORE} ]" -- echo "$${@:1}" --} -- --check --log=$$(${options['run']}) && success || failure "$$log" - - -Repository: plone.app.contenttypes +M plone/formwidget/recurrence/browser/json_recurrence.py + +diff --git a/plone/formwidget/recurrence/browser/json_recurrence.py b/plone/formwidget/recurrence/browser/json_recurrence.py +index 1356ec0..a3ba94c 100644 +--- a/plone/formwidget/recurrence/browser/json_recurrence.py ++++ b/plone/formwidget/recurrence/browser/json_recurrence.py +@@ -171,6 +171,10 @@ def json_string(self): + ((x * batch_size) + 1, (x + 1) * batch_size) + for x in range(first_batch, last_batch + 1) + ] ++ # cur_batch must be set relative to first_batch as the batches array ++ # is cut down, but the cur_batch variable is not. With this we prevent ++ # a list index out of range error ++ cur_batch = cur_batch - first_batch + # correct number of occurrences in current batch + (cur_batch_start, cur_batch_end) = batches[cur_batch] + if cur_batch_end > len(occurrences): + + +Repository: plone.formwidget.recurrence Branch: refs/heads/master -Date: 2015-11-26T14:06:03+01:00 -Author: Gil Forcada Codinachs (gforcada) -Commit: https://github.com/plone/plone.app.contenttypes/commit/9d9e545c948cea6dcfc2701253a2fa311c8e708b +Date: 2015-11-18T11:06:11+01:00 +Author: Julian Handl (julianhandl) +Commit: https://github.com/plone/plone.formwidget.recurrence/commit/2abc01b3aa51fefefcf719e04550dd9b9caa0824 -Templates folder is no longer there +Update CHANGES.rst Files changed: -M MANIFEST.in - -diff --git a/MANIFEST.in b/MANIFEST.in -index a449fe5..b3e5a03 100644 ---- a/MANIFEST.in -+++ b/MANIFEST.in -@@ -5,5 +5,3 @@ graft docs - graft plone +M CHANGES.rst + +diff --git a/CHANGES.rst b/CHANGES.rst +index 50f37db..3c2e3d6 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -8,6 +8,8 @@ Fixes: - global-exclude *.pyc -- --prune templates + - Removed unittest2 dependency. + [gforcada] ++- Fix list index out of range at pagination. ++ [julianhandl] + + + 2.0.1 (2015-06-05) -Repository: plone.app.contenttypes +Repository: plone.formwidget.recurrence Branch: refs/heads/master -Date: 2015-12-04T00:22:00+01:00 +Date: 2015-12-04T00:24:50+01:00 Author: Jens W. Klein (jensens) -Commit: https://github.com/plone/plone.app.contenttypes/commit/f2f602703b619bcfb8f6665af2515cefb00ad799 +Commit: https://github.com/plone/plone.formwidget.recurrence/commit/9991a0c38b57d0dce457df663e6fa1fbf809293c -Merge pull request #302 from plone/gforcada-patch-1 +Merge pull request #18 from julianhandl/master -Remove outdated script +Fix index out of range bug for current batch Files changed: -M MANIFEST.in -D templates/code-analysis.sh - -diff --git a/MANIFEST.in b/MANIFEST.in -index a449fe5..b3e5a03 100644 ---- a/MANIFEST.in -+++ b/MANIFEST.in -@@ -5,5 +5,3 @@ graft docs - graft plone +M CHANGES.rst +M plone/formwidget/recurrence/browser/json_recurrence.py + +diff --git a/CHANGES.rst b/CHANGES.rst +index 50f37db..3c2e3d6 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -8,6 +8,8 @@ Fixes: + + - Removed unittest2 dependency. + [gforcada] ++- Fix list index out of range at pagination. ++ [julianhandl] + - global-exclude *.pyc -- --prune templates -diff --git a/templates/code-analysis.sh b/templates/code-analysis.sh -deleted file mode 100644 -index b12e822..0000000 ---- a/templates/code-analysis.sh -+++ /dev/null -@@ -1,53 +0,0 @@ --#!/bin/bash --RESTORE='\033[0m' --RED='\033[00;31m' --GREEN='\033[00;32m' -- --title="${options['title']}" -- --function check { -- command -v ${options.get('check', '')} >/dev/null 2>&1 || { -- echo -ne $$title -- #echo >&2 "${options.get('check', '')} not installed!"; -- len=$${#title} -- gap=$$((18-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ \033[00;33mSKIP\033[0m ]" -- exit 1; -- } --} -- --function success { -- echo -ne $$title -- len=$${#title} -- gap=$$((20-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ \033[00;32mOK\033[0m ]" --} -- --function failure { -- echo -ne $$title -- len=$${#title} -- gap=$$((15-$$len)) -- i=0 -- while [ $$i -le $$gap ] -- do -- echo -ne " " -- i=$$(( $$i + 1 )) -- done -- echo -e " [ $${RED}FAILURE$${RESTORE} ]" -- echo "$${@:1}" --} -- --check --log=$$(${options['run']}) && success || failure "$$log" + 2.0.1 (2015-06-05) +diff --git a/plone/formwidget/recurrence/browser/json_recurrence.py b/plone/formwidget/recurrence/browser/json_recurrence.py +index 1356ec0..a3ba94c 100644 +--- a/plone/formwidget/recurrence/browser/json_recurrence.py ++++ b/plone/formwidget/recurrence/browser/json_recurrence.py +@@ -171,6 +171,10 @@ def json_string(self): + ((x * batch_size) + 1, (x + 1) * batch_size) + for x in range(first_batch, last_batch + 1) + ] ++ # cur_batch must be set relative to first_batch as the batches array ++ # is cut down, but the cur_batch variable is not. With this we prevent ++ # a list index out of range error ++ cur_batch = cur_batch - first_batch + # correct number of occurrences in current batch + (cur_batch_start, cur_batch_end) = batches[cur_batch] + if cur_batch_end > len(occurrences):