jackalope / jackalope-doctrine-dbal

Doctrine DBAL transport implementation for Jackalope
http://jackalope.github.io
Other
143 stars 60 forks source link

ISDESCENDANTNODE does not work with path containing a dot #305

Open danrot opened 9 years ago

danrot commented 9 years ago

Somebody has encountered an issue in combination with Sulu: https://github.com/sulu-io/sulu-standard/issues/536#issuecomment-149315457

I could track down the problem to the fact that this ISDESCENDANTNODE function does not work correctly, when the path contains a dot. So the following query returns nothing, although the node at the given path has child nodes:

SELECT * FROM [nt:unstructured] AS page WHERE ISDESCENDANTNODE(page, '/cmf/htl.do/contents');

I guess this should be working, since the dot doesn't have any special meaning (at least none that I am aware of), and this query works like a charm when used with jackrabbit.

dbu commented 8 years ago

yes, this indeed should work. it looks like we have some problem with escaping here. can you find out what the sql query is that gets executed for this?

danrot commented 8 years ago

Not sure what the best way to do this is... Tried to find it in the logs, the only thing that made sense was this one:

[2015-11-02 23:06:12] doctrine.DEBUG:                SELECT * FROM phpcr_nodes               WHERE path = :path                 AND workspace_name = :workspace               ORDER BY depth, sort_order ASC {":path":"/cmf/sulu.io",":pathd":"/cmf/sulu.io/%",":workspace":"default"} []
dbu commented 8 years ago

Not sure what the best way to do this is...

try to work with the phpcr-api-tests. there should be a test about ISDESCENDANTNODE i would hope, that you could change to a path with dot, and if we miss the whole test, you could add one.

dbu commented 8 years ago

btw, could this be related to https://github.com/phpcr/phpcr-utils/pull/104 ?

i never wrapped this up. there was some weird regression that i did not figure out. maybe check if that is the reason for this problem and if so, look into it.

danrot commented 7 years ago

Seems like I have messed something up back then... I just realized that this is an error in Sulu. Should be fixed with https://github.com/sulu/sulu/pull/3039, so this issue can be closed.

danrot commented 7 years ago

I am afraid I was too fast, mixed that up with another issue we've had 🙈 Sorry, was a tough week.

dbu commented 7 years ago

is this because of https://github.com/phpcr/phpcr-utils/pull/104 or something else?

danrot commented 7 years ago

I don't know... Tried to test it, but when I check out the other branch and execute the query I get the following error:

  [Symfony\Component\Debug\Exception\FatalThrowableError]
  [] operator not supported for strings

Maybe because I am already using a newer version?

dbu commented 7 years ago

odd. would you see where this exception is thrown? the utils branch is very old and probably won't work with current jackalope. i never got around to dig through the confusion there. if you have time to rebase the branch and figure out what is going wrong it would be great.