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

Reference property value inconsistency #248

Open
dantleech opened this issue Oct 15, 2014 · 9 comments
Open

Reference property value inconsistency #248

dantleech opened this issue Oct 15, 2014 · 9 comments
Assignees
Labels

Comments

@dantleech
Copy link
Contributor

Sometimes a REFERENCE property returns an array of UUIDs, other times an array of objects (with UUIDs as keys). So the following hack is necessary:

    public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
    {
        $refs = $node->getPropertyValueWithDefault($property->getName(), array());
        $snippets = array();

        foreach ($refs as $i => $uuid) {
            if (UUIDHelper::isUUID($i)) {
                $uuid= $i;
            }

            $snippets[] = $this->contentMapper->load($uuid, $webspaceKey, $languageCode);
        }

        // ...
    }
@dantleech dantleech added the bug label Oct 15, 2014
@dbu dbu added this to the 1.2 milestone Nov 5, 2014
@dbu
Copy link
Member

dbu commented Nov 5, 2014

do you think you can fix tihs for 1.2?

i think according to jcr, getValue on a (WEAK)REFERENCE should give you the referenced node. only asking for the string should give the uuid.

@dantleech
Copy link
Contributor Author

Yeah. I will try and make myself a Jackalope hackday before the end of the month :)

@dbu
Copy link
Member

dbu commented Dec 5, 2014

did you get to this? it could also be that some of your properties are string properties, or something called getString instead of getValue.

@dantleech
Copy link
Contributor Author

No.. I did do a little hackday but I missed this somehow .. next time :)

@dbu
Copy link
Member

dbu commented Jan 17, 2015

is this still happening? can you say when it happens, or even provide a test that demonstrates the problem?

@dbu
Copy link
Member

dbu commented Feb 9, 2015

ping @dantleech - last open milestone 1.2 issue in this repo

@dbu dbu removed this from the 1.2 milestone Feb 9, 2015
@dbu
Copy link
Member

dbu commented Feb 9, 2015

if you can provide a failing phpcr-api-test i can fix this (hopefully)

@dantleech dantleech self-assigned this Feb 9, 2015
@dantleech
Copy link
Contributor Author

Assigned to myself

@dbu
Copy link
Member

dbu commented May 2, 2015

ping

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

No branches or pull requests

2 participants