Page MenuHomeIn-Portal Phabricator

INP-1692 - Allow searching pages by their Content Block content
AcceptedPublic

Authored by erik on Apr 24 2017, 9:38 AM.

Details

Reviewers
alex
Summary

Allow searching pages by their Content Block content

Test Plan

Main test

  1. reinstall In-Portal
  2. login to Admin Console
  3. go to ConfigurationWebsiteSearch section
  4. confirm that Content Block Content setting is available after Description setting
  5. set checked Simple Search checkbox for Content Block Content field
  6. go to Website & ContentBrowse Website section
  7. click on Content Mode tab
  8. click on Edit Content #1 button
  9. input text Content and press Save button
  10. input text Content in the sidebar Search Box and press Find It! button
  11. confirm that Home page is found and displayed in Category Search Results page

Languages test

  1. go to ConfigurationWebsiteRegional section
  2. add some language
  3. go to Website & ContentBrowse Website section
  4. click on Content Mode tab
  5. click on Edit Content #1 button
  6. choose added secondary language in the Language dropdown of Content Editor
  7. input text Language and press Save button
  8. choose added secondary language in the Language dropdown of Front-End page
  9. input text Language in the sidebar Search Box and press Find It! button
  10. confirm that Home page is found and displayed in Category Search Results page

Revision test

  1. go to ConfigurationWebsiteRegional section
  2. make Enable Revision Control for Section Content checkbox checked
  3. press Save button
  4. go to Website & ContentBrowse Website section
  5. click on Content Mode tab
  6. click on Edit Content #1 button
  7. input text Revision and press Save button
  8. press Save button in the revisions control to publish new revision
  9. input text Content in the sidebar Search Box and press Find It! button
  10. confirm that nothing is found with this old revision related keyword
  11. input text Revision in the sidebar Search Box and press Find It! button
  12. confirm that Home page is found and displayed in Category Search Results page

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.3.x
Lint
Lint ErrorsExcuse: Full file re-formatting is not part of this task.
SeverityLocationCodeMessage
Errorcore/units/categories/categories_config.php:437PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Errorcore/units/categories/categories_config.php:437PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/page_revisions/page_revisions_config.php:70PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Errorcore/units/page_revisions/page_revisions_config.php:70PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/page_revisions/page_revisions_config.php:72PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Errorcore/units/page_revisions/page_revisions_config.php:72PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Unit
No Unit Test Coverage
Build Status
Buildable 718
Build 718: arc lint + arc unit

Event Timeline

erik updated this revision to Diff 729.Apr 24 2017, 9:38 AM
erik retitled this revision from to INP-1692 Allow searching pages by their Content Block content.
erik updated this object.
erik edited the test plan for this revision. (Show Details)
erik added a reviewer: alex.
erik added 1 JIRA issue(s): INP-1692.
alex requested changes to this revision.Apr 25 2017, 3:29 AM
alex edited edge metadata.

Also update test plan:

  1. change enabling of search setting info confirmation that it's present in correct place
  2. add test to confirm, that search across languages works
  3. add test to confirm, that only data from live page revision is used during search
core/install/upgrades.sql
3062
  1. this must also be done in /core/install/install_data.sql
  2. enable for both Simple and Advanced Searches by default
  3. set weight of 1 by default
  4. via changing DisplayOrder field move this search setting after Description field

  1. no record present in SearchConfig table after Clean Install
  2. all existing search fields are enabled by default for advanced search and it makes sense to enable this one for simple search as well
  3. most likely fields with 0 weight will reduce page rank in search results
  4. position of the field doesn't represent what's in it (I guess all text fields are on top)
core/units/categories/categories_config.php
438

add 'formatter' => 'kMultiLanguage', after type field option


the OnSimpleSearch event behaves different with formatter specified

core/units/page_revisions/page_revision_eh.php
227–230

inline


there only 1 condition left

227–235

perform this SQL directly in the syncPageContent method

228

remove page filter


the RevisionId is unique to a page, it's RevisionNumber that isn't

242–249

specify $revision_id instead of $blocks

254

please inline


variable used only once

272

inline

273

format as multi-line function call

This revision now requires changes to proceed.Apr 25 2017, 3:29 AM
erik updated this revision to Diff 730.Apr 25 2017, 6:07 AM
erik edited edge metadata.

Made all requested fixes.

erik edited the test plan for this revision. (Show Details)Apr 25 2017, 6:08 AM
erik edited edge metadata.
alex requested changes to this revision.Apr 25 2017, 6:23 AM
alex edited edge metadata.
alex added inline comments.
core/install/upgrades.sql
3062

replace DisplayOrder >= 5 with DisplayOrder BETWEEN 5 AND 7


there database after clean install and after upgrade should look the same

core/units/page_revisions/page_revision_eh.php
271

Use revision ID given to the method.

This revision now requires changes to proceed.Apr 25 2017, 6:23 AM
erik updated this revision to Diff 731.Apr 25 2017, 6:37 AM
erik edited edge metadata.
erik edited the test plan for this revision. (Show Details)

Made all necessary fixes.

erik updated this revision to Diff 732.Apr 25 2017, 6:50 AM
erik edited edge metadata.

Made upgrade SQL optimization.

alex accepted this revision.Apr 25 2017, 6:54 AM
alex edited edge metadata.
This revision is now accepted and ready to land.Apr 25 2017, 6:54 AM
alex retitled this revision from INP-1692 Allow searching pages by their Content Block content to INP-1692 - Allow searching pages by their Content Block content.Aug 3 2022, 4:42 AM