Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Change default search method and results order used when searching for content on internal links #129

Closed
wants to merge 3 commits into from

Conversation

hvelarde
Copy link
Member

@hvelarde hvelarde commented Dec 1, 2015

Refs. #127

…r content on internal links

Now we search by Title (as it is faster than SearchableText) and return results sorted by relevance instead of sortable_title.
@rodfersou
Copy link
Member

getIcon = lambda brain: plone_view.getIcon(brain).html_tag()
else:
# Plone >= 4
getIcon = lambda brain: plone_layout.getIcon(brain)()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plone 3?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a reference of this method at line 58 (before change) or 51 (after change)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you saw the whole commit? 4285de9

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry

@rodfersou
Copy link
Member

@rodfersou
Copy link
Member

I got some unrelated errors here:

Failure in test test_json_details_document (Products.TinyMCE.tests.test_adapters.AdaptersTestCase)
Traceback (most recent call last):
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/srv/cartacapital.portal.buildout/src/Products.TinyMCE/Products/TinyMCE/tests/test_adapters.py", line 60, in test_json_details_document
    self.assertEqual(details[key], val)
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 521, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 752, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 734, in assertSequenceEqual
    self.fail(msg)
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 415, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: [] != ['anchor']

Second list contains 1 additional elements.
First extra element 0:
anchor

- []
+ ['anchor']
Failure in test test_json_folder_listing_icon (Products.TinyMCE.tests.test_adapters.AdaptersTestCase)
Traceback (most recent call last):
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/srv/cartacapital.portal.buildout/src/Products.TinyMCE/Products/TinyMCE/tests/test_adapters.py", line 134, in test_json_folder_listing_icon
    r'"icon": "<img width=\\"16\\" height=\\"16\\" src=\\"http://nohost/plone/application.png\\" alt=\\"File.*?\\" />"')
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 1011, in assertRegexpMatches
    raise self.failureException(msg)
AssertionError: Regexp didn't match: '"icon": "<img width=\\\\"16\\\\" height=\\\\"16\\\\" src=\\\\"http://nohost/plone/application.png\\\\" alt=\\\\"File.*?\\\\" />"' not found in '{"parent_url": "", "path": [{"url": "http://nohost/plone", "icon": "<img src=\\"img/home.png\\" width=\\"16\\" height=\\"16\\" />", "title": "Home"}], "upload_allowed": true, "items": [{"description": "", "portal_type": "Document", "id": "document", "uid": "899f75f7cf034e8db8db41f1d0139b94", "is_image": false, "title": "document", "url": "http://nohost/plone/document", "is_folderish": false, "normalized_type": "document", "review_state": null, "icon": null}, {"description": "", "portal_type": "Folder", "id": "folder", "uid": "f64e00cdb79d4feca70d02798c84fa4b", "is_image": false, "title": "folder", "url": "http://nohost/plone/folder", "is_folderish": true, "normalized_type": "folder", "review_state": null, "icon": null}, {"description": "", "portal_type": "File", "id": "somefile.bin", "uid": "3b93fa64b4b3492a8d199cb3b2cd543c", "is_image": false, "title": "somefile.bin", "url": "http://nohost/plone/somefile.bin", "is_folderish": false, "normalized_type": "file", "review_state": null, "icon": "<img width=\\"16\\" height=\\"16\\" src=\\"http://nohost/plone/png.png\\" alt=\\"File Octet Stream\\" />"}]}'
Error in test test_json_save (Products.TinyMCE.tests.test_adapters.AdaptersTestCase)
Traceback (most recent call last):
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/srv/cartacapital.portal.buildout/src/Products.TinyMCE/Products/TinyMCE/tests/test_adapters.py", line 187, in test_json_save
    obj.save(fieldname='text', text='<p>test</p>')
  File "/srv/cartacapital.portal.buildout/src/Products.TinyMCE/Products/TinyMCE/adapters/Save.py", line 18, in save
    self.context.getField(fieldname).set(self.context, text, mimetype='text/html')
AttributeError: getField
Failure in test test_json_upload_not_allowed (Products.TinyMCE.tests.test_adapters.AdaptersTestCase)
Traceback (most recent call last):
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/srv/cartacapital.portal.buildout/src/Products.TinyMCE/Products/TinyMCE/tests/test_adapters.py", line 215, in test_json_upload_not_allowed
    self.assertTrue('resolveuid/' in msg)
  File "/srv/cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 427, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not True

and more..

@rodfersou
Copy link
Member

And looks like jenkins for plone 5.0 is not working http://jenkins.plone.org/job/pull-request-5.0/608/console

@hvelarde
Copy link
Member Author

hvelarde commented Dec 2, 2015

@rodfersou according with plone/buildout.coredev@e96c891 this branch is invalid we need to find out were to fix this instead.

@jensens can you point us to the right place?

@hvelarde hvelarde closed this Dec 2, 2015
@hvelarde hvelarde deleted the issue_127_plone_50 branch December 2, 2015 15:21
@hvelarde
Copy link
Member Author

hvelarde commented Jan 8, 2016

can you point us to the place we have to fix this for Plone 5.0 @plone/framework-team?

@jensens
Copy link
Member

jensens commented Jan 8, 2016

tinymce is a new mockup widget in 5.0 and Products.TinyMCE not part of core anymore.

@hvelarde
Copy link
Member Author

hvelarde commented Jan 8, 2016

@rodfersou I think we must give up until further notice then

@jensens
Copy link
Member

jensens commented Jan 8, 2016

I think here the 1.3.x branch is what is current and developed further for Plone 4.3. Afaik master was part of early 5.0, but then get kicked out in favour of the new implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants