Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
cbb6bb7d
Commit
cbb6bb7d
authored
Dec 29, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Jan 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Formulator] Pass through correct REQUEST inside fields and forms
parent
d4b63a3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
3 deletions
+6
-3
product/ERP5Form/EditorField.py
product/ERP5Form/EditorField.py
+2
-0
product/ERP5Form/Form.py
product/ERP5Form/Form.py
+1
-2
product/ERP5Form/tests/testListBox.py
product/ERP5Form/tests/testListBox.py
+1
-0
product/Formulator/Field.py
product/Formulator/Field.py
+2
-1
No files found.
product/ERP5Form/EditorField.py
View file @
cbb6bb7d
...
@@ -80,6 +80,8 @@ class EditorWidget(Widget.TextAreaWidget):
...
@@ -80,6 +80,8 @@ class EditorWidget(Widget.TextAreaWidget):
"""
"""
Render editor
Render editor
"""
"""
if
REQUEST
is
None
:
REQUEST
=
get_request
()
here
=
REQUEST
[
'here'
]
here
=
REQUEST
[
'here'
]
text_editor
=
field
.
get_value
(
'text_editor'
)
text_editor
=
field
.
get_value
(
'text_editor'
)
if
text_editor
==
"svg_editor"
:
if
text_editor
==
"svg_editor"
:
...
...
product/ERP5Form/Form.py
View file @
cbb6bb7d
...
@@ -263,7 +263,7 @@ class DefaultValue(StaticValue):
...
@@ -263,7 +263,7 @@ class DefaultValue(StaticValue):
self
.
value
=
value
self
.
value
=
value
def
__call__
(
self
,
field
,
id
,
**
kw
):
def
__call__
(
self
,
field
,
id
,
**
kw
):
REQUEST
=
get_request
()
REQUEST
=
kw
.
get
(
'REQUEST'
,
None
)
or
get_request
()
try
:
try
:
form
=
field
.
aq_parent
form
=
field
.
aq_parent
ob
=
REQUEST
.
get
(
'cell'
,
getattr
(
form
,
'aq_parent'
,
None
))
ob
=
REQUEST
.
get
(
'cell'
,
getattr
(
form
,
'aq_parent'
,
None
))
...
@@ -278,7 +278,6 @@ class DefaultValue(StaticValue):
...
@@ -278,7 +278,6 @@ class DefaultValue(StaticValue):
value
=
ob
.
getProperty
(
self
.
key
)
value
=
ob
.
getProperty
(
self
.
key
)
except
Unauthorized
:
except
Unauthorized
:
value
=
ob
.
getProperty
(
self
.
key
,
d
=
value
,
checked_permission
=
'View'
)
value
=
ob
.
getProperty
(
self
.
key
,
d
=
value
,
checked_permission
=
'View'
)
REQUEST
=
kw
.
get
(
'REQUEST'
,
get_request
())
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
REQUEST
.
set
(
'read_only_%s'
%
self
.
key
,
1
)
REQUEST
.
set
(
'read_only_%s'
%
self
.
key
,
1
)
except
(
KeyError
,
AttributeError
):
except
(
KeyError
,
AttributeError
):
...
...
product/ERP5Form/tests/testListBox.py
View file @
cbb6bb7d
...
@@ -730,6 +730,7 @@ class TestListBox(ERP5TypeTestCase):
...
@@ -730,6 +730,7 @@ class TestListBox(ERP5TypeTestCase):
"""
"""
portal
=
self
.
getPortal
()
portal
=
self
.
getPortal
()
request
=
get_request
()
request
=
get_request
()
request
[
'here'
]
=
portal
.
foo_module
portal
.
ListBoxZuite_reset
()
portal
.
ListBoxZuite_reset
()
form
=
portal
.
FooModule_viewFooList
form
=
portal
.
FooModule_viewFooList
self
.
assertEqual
(
None
,
request
.
get
(
'listbox_form_id'
))
self
.
assertEqual
(
None
,
request
.
get
(
'listbox_form_id'
))
...
...
product/Formulator/Field.py
View file @
cbb6bb7d
...
@@ -111,7 +111,8 @@ class Field:
...
@@ -111,7 +111,8 @@ class Field:
# add 'here' if not in kw
# add 'here' if not in kw
if
not
kw
.
has_key
(
'here'
):
if
not
kw
.
has_key
(
'here'
):
kw
[
'here'
]
=
self
.
aq_parent
kw
[
'here'
]
=
self
.
aq_parent
kw
[
'request'
]
=
self
.
REQUEST
if
not
kw
.
has_key
(
'request'
):
kw
[
'request'
]
=
self
.
REQUEST
value
=
tales_expr
.
__of__
(
self
)(
value
=
tales_expr
.
__of__
(
self
)(
field
=
self
,
field
=
self
,
form
=
self
.
aq_parent
,
**
kw
)
form
=
self
.
aq_parent
,
**
kw
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment