Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX-Documents have no size #2526

Closed
pbauer opened this issue Sep 27, 2018 · 3 comments · Fixed by plone/plone.dexterity#89
Closed

DX-Documents have no size #2526

pbauer opened this issue Sep 27, 2018 · 3 comments · Fixed by plone/plone.dexterity#89
Assignees
Milestone

Comments

@pbauer
Copy link
Sponsor Member

pbauer commented Sep 27, 2018

Dexterity-Based Documents with a richtext-field as primary field do not have a size.
This is a regression compared to Archetypes.

The failing test in CMFPlone (py3 branch) is:

def test_getObjSize(self):
    from Products.CMFPlone.CatalogTool import getObjSize
    get_size = getObjSize.callable
    # FIXME: getObjSize die not count text in DX
    self.doc.text = RichTextValue('a' * 1000)
    self.doc.reindexObject()
    self.assertEqual(get_size(self.doc), '1 KB')

plone.app.contenttypes only has getObjSize indexers for files and images.

@reinhardt
Copy link
Contributor

The test passes fine for me. The getObjSize indexer calls DAVResourceMixin.get_size() which returns 1000 which is in turn correctly converted to "1 KB".

Am I missing something?

@reinhardt reinhardt assigned pbauer and unassigned reinhardt Oct 1, 2018
@reinhardt
Copy link
Contributor

reinhardt commented Oct 1, 2018

I'll have a look at the comment in plone/plone.dexterity#89 (comment).

Edit: Yes, could reproduce that.

@reinhardt reinhardt assigned reinhardt and unassigned pbauer Oct 1, 2018
reinhardt added a commit that referenced this issue Oct 1, 2018
@reinhardt reinhardt moved this from To do to In Review in Saltlab Sprint Oct 1, 2018
Saltlab Sprint automation moved this from In Review to Done Oct 1, 2018
@davisagli
Copy link
Sponsor Member

Good catch and thanks for the fix, @reinhardt

pbauer added a commit to plone/plone.restapi that referenced this issue Oct 1, 2018
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Oct 1, 2018
Branch: refs/heads/master
Date: 2018-10-01T15:45:27+02:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: plone/plone.restapi@7ba3df1

fix test after plone/Products.CMFPlone#2526 was fixed

Files changed:
M src/plone/restapi/tests/test_search.py
tisto added a commit to plone/plone.restapi that referenced this issue Oct 1, 2018
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Oct 1, 2018
Branch: refs/heads/master
Date: 2018-10-01T20:01:13+02:00
Author: Timo Stollenwerk (tisto) <tisto@plone.org>
Commit: plone/plone.restapi@793b7a3

Revert "fix test after plone/Products.CMFPlone#2526 was fixed"

This reverts commit 7ba3df12c0afe494e1c6ddc77097b09f5266dced.

Files changed:
M src/plone/restapi/tests/test_search.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants