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

FEATURE: Support search by property & exact value in NodeDataRepository #1

Merged
merged 11 commits into from
Apr 14, 2016

Conversation

daniellienert
Copy link
Member

Currently it is only possible to search through the properties by
giving a string that matches for any key or value found in the
jsonified properties field.

With this change, the term can also be an array to match exactly on a
given key / value combination.
The search term could be given as ['key' => 'value'].

NEOS-1460 #close

Currently it is only possible to search through the properties by
giving a string that matches for any key or value found in the
jsonified properties field.

With this change, the term can also be an array to match exactly on a
given key / value combination.
The search term could be given as `array('key' => 'value').

Change-Id: Ie58b66503db561e6cd1b7b2de5f2c1cb80fe03d7
Resolves: NEOS-1460
Releases: master
Change term check to allow arrays.

Change-Id: Iddc4d6686cdb8ab1941609ab9301bd00800df184
Resolves: NEOS-1460
Releases: master
@hlubek
Copy link
Contributor

hlubek commented Aug 19, 2015

Hi Daniel,

pretty nice feature! I'd really like to have a functional test for this because we had a lot of trouble with database (text) search and MySQL / PostgreSQL / Sqlite compatibility. It would also be much easier to cover different cases in the future.

One other thing: I think we should convert the given term the same way we encode the JSON value in a node. That way we could search for a Node reference or non-string values too.

kitsunet referenced this pull request in kitsunet/neos-development-collection Sep 2, 2015
Fixes an issue in NodeView which causes an exception on rare occasions
when node type labels are empty.

The original error message was::

  Uncaught exception #1: Warning: strpos(): Empty needle in
  TYPO3_Neos_Service_View_NodeView.php line 273

Change-Id: Iedd0b4a2db3a0c3764b7377a8f28c61ef0dcf712
Releases: master, 1.2
Original-Commit-Hash: 8e5fe3448f4d647d0f80fc9e62ab41014cb7b560
@daniellienert daniellienert self-assigned this Sep 15, 2015
Tests the simple property search as well as the search for a specific property.
@daniellienert
Copy link
Member Author

@hlubek - I added a test for the simple search in the property field and the search for a specific named property.

@skurfuerst
Copy link
Member

@hlubek ping ;-)

@kdambekalns
Copy link
Member

TL;DR: 👎

Ok, first of all – what about closing this PR and creating a new one? It seems the Travis reporting is broken for "old" PRs like this one…

The change looks good, and works most of the time on MySQL and (probably) never on PostgreSQL. Why? Because the search query does not specify an ordering so the findNodeByPropertySearch test (relying on the order of returned nodes) is not really reliable.

The question now is: Is the order of returned node important and should be made consistent? Or should the test be adjusted to check for the expected results even when the order changes?

@kdambekalns
Copy link
Member

Here is an "example failure" on MySQL: https://travis-ci.org/kdambekalns/neos-development-collection/jobs/89391932

@aertmann aertmann closed this Nov 9, 2015
@aertmann aertmann reopened this Nov 9, 2015
@aertmann
Copy link
Contributor

aertmann commented Nov 9, 2015

Closed/reopened to fix test run

@kdambekalns: The ordering issue is unrelated to the actual change though, but made visible because of the test..

Adding order is potentially a breaking change, although a improvement. Also what ordering even makes sense in this case? A "semi random" one using the identifiers or the creation date or last modified date?

Because of that I'd suggest to make the test order independent and tackle the ordering in a separate change.

@kitsunet
Copy link
Member

kitsunet commented Nov 9, 2015

Thinking how we use this, order related to paths could make sense maybe

@aertmann
Copy link
Contributor

aertmann commented Nov 9, 2015

@kitsunet: been down that road, it's a dead end.. ordering in SQL by nested path and sort index correctly is a nightmare

Which made me remember https://jira.neos.io/browse/NEOS-989 where I tried it. That's actually the issue exposed by the tests.

@kitsunet
Copy link
Member

kitsunet commented Nov 9, 2015

right, both won't work, I am aware. I just thought path plain and simple... Although change date could be an interesting choice thinking about it. DESC then.

skurfuerst pushed a commit that referenced this pull request Nov 10, 2015
[TASK] Merge changes from 2.0
@daniellienert daniellienert reopened this Apr 12, 2016
@aertmann
Copy link
Contributor

good work @daniellienert, lets get this in.. ping @hlubek @kdambekalns @kitsunet

@aertmann
Copy link
Contributor

can't have a failed first pull request 😄

@kdambekalns kdambekalns merged commit 85031f0 into neos:master Apr 14, 2016
hlubek added a commit that referenced this pull request Aug 25, 2016
TASK: Adjust Travis build config to add PostgreSQL 9.5
Sebobo added a commit that referenced this pull request Jan 24, 2017
Refactoring and fixing of various issues and merge conflicts
hlubek pushed a commit that referenced this pull request Sep 22, 2017
@daniellienert daniellienert deleted the 42011 branch February 19, 2018 20:03
kitsunet pushed a commit that referenced this pull request Apr 23, 2018
TASK: Refactor icon name migration to mapper
kitsunet pushed a commit that referenced this pull request Nov 30, 2020
DOCS: Remove PackageFactory Namspace
kitsunet pushed a commit that referenced this pull request Nov 30, 2020
TASK: Add PHP 7.2 to the tested plattforms
skurfuerst pushed a commit that referenced this pull request May 3, 2022
Introduce Variant Type "same" in API
robert-heinig pushed a commit to robert-heinig/neos-development-collection that referenced this pull request Oct 4, 2022
TASK: Raise dependency doctrine/dbal to 2.7.0
bwaidelich added a commit that referenced this pull request Jan 6, 2023
Fixes a regression introduced by an invalid upmerge of 7b1e5c4
leading to an exception

    Neos\Eel\Helper\ArrayHelper::keys(): Argument #1 ($array) must be of type iterable, null given
markusguenther pushed a commit that referenced this pull request Feb 22, 2023
…back-suggestions

BUGFIX: Fix behavior of "discard selected changes" button in workspace module
mhsdesign added a commit that referenced this pull request Sep 21, 2023
Previously in php 7.4 this `Neos\Fusion\Exception\MissingFusionObjectException` was thrown

> No Fusion object found in path ""

but with php 8 this `ValueError` is thrown which is unexpected

> strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)

This change takes care of throwing an explicit `Neos\Fusion\Exception` instead:

> Fusion path cannot be empty.
mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this pull request Jan 16, 2024
Related: neos#4619

Primitive values cannot be shown currently:

```
flow nodetypes:show Neos.Neos:Document --path properties.title.ui.label
Neos\ContentRepository\Command\NodeTypesCommandController_Original::truncateArrayAtLevel(): Argument neos#1 ($array) must be of type array, string given
```
mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this pull request Oct 21, 2024
…in tests

> Type error: Neos\ContentRepository\Core\Tests\Behavior\Fixtures\PostalAddress::__construct(): Argument neos#1 ($streetAddress) must be of type string, null given
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants