-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2017-03-08T21:03:52Z Author: Tom Gross (tomgross) <itconsense@gmail.com> Commit: plone/plone.app.z3cform@5106714 Catch TypeError occuring on conflicting subrequests in inline validation Files changed: M CHANGES.rst M plone/app/z3cform/inline_validation.py Repository: plone.app.z3cform Branch: refs/heads/master Date: 2017-03-08T23:09:04+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.app.z3cform@04076b0 Merge pull request #62 from plone/catch_typerror Catch TypeError occuring on conflicting subrequests in inline validation Files changed: M CHANGES.rst M plone/app/z3cform/inline_validation.py
- Loading branch information
Showing
1 changed file
with
51 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,262 +1,88 @@ | ||
Repository: mockup | ||
Repository: plone.app.z3cform | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2017-03-07T19:25:40+01:00 | ||
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> | ||
Commit: https://github.com/plone/mockup/commit/fa362abb87cd17a66fa625daeeea4fc585aa6a60 | ||
Date: 2017-03-08T21:03:52Z | ||
Author: Tom Gross (tomgross) <itconsense@gmail.com> | ||
Commit: https://github.com/plone/plone.app.z3cform/commit/5106714c3cebfb4d39b9c26f98fba87edb3712ad | ||
|
||
fix structure pattern: if title is empty then show items id | ||
Catch TypeError occuring on conflicting subrequests in inline validation | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M mockup/patterns/structure/templates/tablerow.xml | ||
M plone/app/z3cform/inline_validation.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 0183579..632b745 100644 | ||
index b1f285f..5d97cdc 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -26,6 +26,9 @@ Bug fixes: | ||
format with date and time in localized format 'L LT' | ||
[jensens] | ||
@@ -14,7 +14,8 @@ New features: | ||
|
||
+- fix structure pattern: if title is empty then show items ID. Also always show ID on mouseover. | ||
+ [jensens] | ||
+ | ||
Bug fixes: | ||
|
||
2.4.0 (2017-02-20) | ||
------------------ | ||
diff --git a/mockup/patterns/structure/templates/tablerow.xml b/mockup/patterns/structure/templates/tablerow.xml | ||
index 740701f..b6efb90 100644 | ||
--- a/mockup/patterns/structure/templates/tablerow.xml | ||
+++ b/mockup/patterns/structure/templates/tablerow.xml | ||
@@ -4,8 +4,12 @@ | ||
<div class="pull-left"> | ||
<a href="<%- viewURL %>" | ||
class="manage state-<%- review_state %> contenttype-<%- contenttype %>" | ||
- title="<%- portal_type %>"> | ||
- <%- Title %> | ||
+ title="<%- id %> (<%- portal_type %>)"> | ||
+ <% if(Title){ %> | ||
+ <%- Title %> | ||
+ <% } else { %> | ||
+ <em><%- id %></em> | ||
+ <% } %> | ||
</a> | ||
<% if(expired){ %> | ||
<span class="plone-item-expired"><%- _t('Expired') %></span> | ||
|
||
|
||
Repository: mockup | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2017-03-08T16:37:18+01:00 | ||
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> | ||
Commit: https://github.com/plone/mockup/commit/a437f6de9df717f92897b7a0af8ecd2633bc266c | ||
|
||
fix structure pattern: if title is empty then show items id instead | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M mockup/patterns/structure/templates/tablerow.xml | ||
M mockup/tests/pattern-structure-test.js | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 632b745..68af37b 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -26,7 +26,7 @@ Bug fixes: | ||
format with date and time in localized format 'L LT' | ||
[jensens] | ||
|
||
-- fix structure pattern: if title is empty then show items ID. Also always show ID on mouseover. | ||
+- fix structure pattern: if title is empty then show items ID. | ||
[jensens] | ||
|
||
|
||
diff --git a/mockup/patterns/structure/templates/tablerow.xml b/mockup/patterns/structure/templates/tablerow.xml | ||
index b6efb90..12ed574 100644 | ||
--- a/mockup/patterns/structure/templates/tablerow.xml | ||
+++ b/mockup/patterns/structure/templates/tablerow.xml | ||
@@ -4,7 +4,7 @@ | ||
<div class="pull-left"> | ||
<a href="<%- viewURL %>" | ||
class="manage state-<%- review_state %> contenttype-<%- contenttype %>" | ||
- title="<%- id %> (<%- portal_type %>)"> | ||
+ title="<%- portal_type %>"> | ||
<% if(Title){ %> | ||
<%- Title %> | ||
<% } else { %> | ||
diff --git a/mockup/tests/pattern-structure-test.js b/mockup/tests/pattern-structure-test.js | ||
index 9b2b88b..be8678a 100644 | ||
--- a/mockup/tests/pattern-structure-test.js | ||
+++ b/mockup/tests/pattern-structure-test.js | ||
@@ -553,6 +553,7 @@ define([ | ||
{ | ||
model: { | ||
'Title': "Dummy Image", | ||
+ 'id': "dummy_page", | ||
'is_folderish': false, | ||
'portal_type': "Image", | ||
'getURL': 'http://nohost/dummy_image' | ||
@@ -561,6 +562,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy File", | ||
+ id: "dummy_file", | ||
is_folderish: false, | ||
portal_type: "File", | ||
getURL: 'http://nohost/dummy_file' | ||
@@ -569,6 +571,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy Blob", | ||
+ id: "dummy_blob", | ||
is_folderish: false, | ||
portal_type: "Blob", | ||
getURL: 'http://nohost/dummy_blob' | ||
@@ -577,6 +580,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy Document", | ||
+ id: "dummy_document", | ||
is_folderish: false, | ||
portal_type: "Document", | ||
getURL: 'http://nohost/dummy_document' | ||
@@ -610,6 +614,7 @@ define([ | ||
-- *add item here* | ||
+- Catch TypeError occuring on conflicting subrequests in inline validation | ||
+ [tomgross] | ||
|
||
var model = new Result({ | ||
'Title': "Dummy Document", | ||
+ 'id': "dummy_document", | ||
'is_folderish': false, | ||
'portal_type': "Document", | ||
'getURL': 'http://nohost/dummy_image', | ||
@@ -631,6 +636,7 @@ define([ | ||
|
||
var model = new Result({ | ||
'Title': "Dummy Document", | ||
+ 'id': "dummy_document", | ||
'is_folderish': false, | ||
'portal_type': "Document", | ||
'getURL': 'http://nohost/dummy_image', | ||
@@ -670,6 +676,7 @@ define([ | ||
2.2.1 (2017-02-12) | ||
diff --git a/plone/app/z3cform/inline_validation.py b/plone/app/z3cform/inline_validation.py | ||
index 3ab940f..10a91c6 100644 | ||
--- a/plone/app/z3cform/inline_validation.py | ||
+++ b/plone/app/z3cform/inline_validation.py | ||
@@ -26,7 +26,7 @@ def __call__(self, fname=None, fset=None): | ||
form = self.context | ||
try: | ||
aq_base(form).update() | ||
- except AttributeError: | ||
+ except (AttributeError, TypeError): | ||
return json.dumps(res) | ||
|
||
var collection = new ResultCollection([{ | ||
'Title': 'Date Columns Test Document', | ||
+ 'id': 'date_columns_test_document', | ||
'is_folderish': false, | ||
'portal_type': 'Document', | ||
'getURL': 'http://nohost/doc', | ||
if getattr(form, 'extractData', None): | ||
|
||
|
||
Repository: mockup | ||
Repository: plone.app.z3cform | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2017-03-08T20:02:55+02:00 | ||
Author: Franco Pellegrini (frapell) <frapell@gmail.com> | ||
Commit: https://github.com/plone/mockup/commit/eb01c10e9efbd036eae5e20c377740a161a073b8 | ||
Date: 2017-03-08T23:09:04+01:00 | ||
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> | ||
Commit: https://github.com/plone/plone.app.z3cform/commit/04076b0dd687436dcfd97380d3eec71fbb9a9f9b | ||
|
||
Merge pull request #748 from plone/jensens-structure-if-emtpy-title-then-show-id | ||
Merge pull request #62 from plone/catch_typerror | ||
|
||
Structure: if emtpy title then show ID instead | ||
Catch TypeError occuring on conflicting subrequests in inline validation | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M mockup/patterns/structure/templates/tablerow.xml | ||
M mockup/tests/pattern-structure-test.js | ||
M plone/app/z3cform/inline_validation.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 0183579..68af37b 100644 | ||
index b1f285f..5d97cdc 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -26,6 +26,9 @@ Bug fixes: | ||
format with date and time in localized format 'L LT' | ||
[jensens] | ||
@@ -14,7 +14,8 @@ New features: | ||
|
||
+- fix structure pattern: if title is empty then show items ID. | ||
+ [jensens] | ||
+ | ||
Bug fixes: | ||
|
||
2.4.0 (2017-02-20) | ||
------------------ | ||
diff --git a/mockup/patterns/structure/templates/tablerow.xml b/mockup/patterns/structure/templates/tablerow.xml | ||
index 740701f..12ed574 100644 | ||
--- a/mockup/patterns/structure/templates/tablerow.xml | ||
+++ b/mockup/patterns/structure/templates/tablerow.xml | ||
@@ -5,7 +5,11 @@ | ||
<a href="<%- viewURL %>" | ||
class="manage state-<%- review_state %> contenttype-<%- contenttype %>" | ||
title="<%- portal_type %>"> | ||
- <%- Title %> | ||
+ <% if(Title){ %> | ||
+ <%- Title %> | ||
+ <% } else { %> | ||
+ <em><%- id %></em> | ||
+ <% } %> | ||
</a> | ||
<% if(expired){ %> | ||
<span class="plone-item-expired"><%- _t('Expired') %></span> | ||
diff --git a/mockup/tests/pattern-structure-test.js b/mockup/tests/pattern-structure-test.js | ||
index 9b2b88b..be8678a 100644 | ||
--- a/mockup/tests/pattern-structure-test.js | ||
+++ b/mockup/tests/pattern-structure-test.js | ||
@@ -553,6 +553,7 @@ define([ | ||
{ | ||
model: { | ||
'Title': "Dummy Image", | ||
+ 'id': "dummy_page", | ||
'is_folderish': false, | ||
'portal_type': "Image", | ||
'getURL': 'http://nohost/dummy_image' | ||
@@ -561,6 +562,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy File", | ||
+ id: "dummy_file", | ||
is_folderish: false, | ||
portal_type: "File", | ||
getURL: 'http://nohost/dummy_file' | ||
@@ -569,6 +571,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy Blob", | ||
+ id: "dummy_blob", | ||
is_folderish: false, | ||
portal_type: "Blob", | ||
getURL: 'http://nohost/dummy_blob' | ||
@@ -577,6 +580,7 @@ define([ | ||
}, { | ||
model: { | ||
Title: "Dummy Document", | ||
+ id: "dummy_document", | ||
is_folderish: false, | ||
portal_type: "Document", | ||
getURL: 'http://nohost/dummy_document' | ||
@@ -610,6 +614,7 @@ define([ | ||
-- *add item here* | ||
+- Catch TypeError occuring on conflicting subrequests in inline validation | ||
+ [tomgross] | ||
|
||
var model = new Result({ | ||
'Title': "Dummy Document", | ||
+ 'id': "dummy_document", | ||
'is_folderish': false, | ||
'portal_type': "Document", | ||
'getURL': 'http://nohost/dummy_image', | ||
@@ -631,6 +636,7 @@ define([ | ||
|
||
var model = new Result({ | ||
'Title': "Dummy Document", | ||
+ 'id': "dummy_document", | ||
'is_folderish': false, | ||
'portal_type': "Document", | ||
'getURL': 'http://nohost/dummy_image', | ||
@@ -670,6 +676,7 @@ define([ | ||
2.2.1 (2017-02-12) | ||
diff --git a/plone/app/z3cform/inline_validation.py b/plone/app/z3cform/inline_validation.py | ||
index 3ab940f..10a91c6 100644 | ||
--- a/plone/app/z3cform/inline_validation.py | ||
+++ b/plone/app/z3cform/inline_validation.py | ||
@@ -26,7 +26,7 @@ def __call__(self, fname=None, fset=None): | ||
form = self.context | ||
try: | ||
aq_base(form).update() | ||
- except AttributeError: | ||
+ except (AttributeError, TypeError): | ||
return json.dumps(res) | ||
|
||
var collection = new ResultCollection([{ | ||
'Title': 'Date Columns Test Document', | ||
+ 'id': 'date_columns_test_document', | ||
'is_folderish': false, | ||
'portal_type': 'Document', | ||
'getURL': 'http://nohost/doc', | ||
if getattr(form, 'extractData', None): | ||
|
||
|