Commit 823a8cae authored by Jérome Perrin's avatar Jérome Perrin

ERP5Form: fix `cell` in Matrixbox TALES context

TALESValue always had a strange behavior of setting the request as `cell` when
rendering a matrixbox in the case where there was no cell at the given
coordinates, but this code was not used, becase the request was not passed in
kw. When in 777c5e6c ([ERP5Form] Pass request to fields, 2017-12-29) we
changed to always pass the request, this changed the behavior. After this
change when there was no matrix cell, in the TALES context the variable `cell`
became request.

This restore the original behavior (cell being the cell or None), by changing
the questionable code that was not used before.
parent 25f8110a
Pipeline #16212 running with stage
......@@ -213,10 +213,7 @@ class TALESValue(StaticValue):
if kw.get('cell') is None:
request = kw.get('REQUEST')
if request is not None:
if getattr(request, 'cell', None) is not None:
kw['cell'] = request.cell
else:
kw['cell'] = request
kw['cell'] = getattr(request, 'cell', None)
if 'cell_index' not in kw and\
getattr(request, 'cell_index', None) is not None:
kw['cell_index'] = request.cell_index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment