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

find() does not return single node with proper context in array #49

Open
testbird opened this issue Jun 14, 2013 · 2 comments
Open

find() does not return single node with proper context in array #49

testbird opened this issue Jun 14, 2013 · 2 comments

Comments

@testbird
Copy link

Should find() return the node context instead of an array, if a singular ID is used instead of a query?

<r:void do='find(17)'>

    The "first_name" property is defined for the Contact klass (see <r:link/>), but find does not seem to enter the context correctly.
    <r:first_name/>

    <br />
    It seems find does not return an array for single nodes (not behaving consistently with the new do='first' requirement yet?)
    <r:first do='first_name'/>
     <r:void do='first.first_name'/>


    <r:Contact?>
            Firstname: <r:first_name/>
    </r:Contact?>

</r:void>

Note that using find makes sense when the ID comes from a visitor's params[] selection, or not?

@testbird
Copy link
Author

The following sqliss workaround for find(), that looks explicitly for 'contacts' seems to work. Looking for 'nodes' does also not make the actual class properties available.

<r:void do='contacts where id = 17 in site'>
    Here comes Mr. <r:void do='last_name'/>,
    <r:void do='first_name'/>
    <r:if test='first_name'>
        <r:set stringo='first_name'/>
    </r:if>
    <r:void do='last_name'/>.
</r:void>

@testbird
Copy link
Author

At least with the auto-first context stuff gone, entering "first" should probably be neccessary. (Find() can also be used to get multiple nodes, right?). So entering "first" will also need to be fixed:

<r:void do='find(17)'>
    The "first_name" property is also not found with the attempt to explicitly enter first node context, it even returns unknown method first() (Node context): 
    <r:first do='first_name'/>
    <r:void do='first.firstname'/>
</r:void>

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

No branches or pull requests

1 participant