-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
partialView() data function weird behaviour #540
Comments
Can you post your includePartial call as well please? Thanks. |
I unfortunately deleted the sample project made to demonstrate the issue, but my includePartial was simply called in the "view/controller/test.cfm" view: [...]
<cfoutput>
<div class="container">
<div class="left">
#includePartial("partialview")#
</div>
</div>
</cfoutput>
[...] with a route like <cfset addRoute(name="home", pattern="", controller="controller", action="test")> |
Can you check if it has to do with naming the variable "query". What if you name it "query2" instead for example, same problem? |
Yes, I can confirm that the issue is only occurring when the variable is named "query". Changing the name to anything else (like "query2") works as intended. |
I don't think this is a bug but we do need to document it better. The "query", "object" and "objects" arguments are special arguments and should not be used for other purposes than what's documented here: http://docs.cfwheels.org/docs/partials
|
Documented here: |
I had to port old code from CF8 to CF11 and upgrade cfwheels from 1.0.X to 1.4.1 and obviously had to fix a few issues of compatibility, nothing special.
However a part of the code just stopped working and I narrowed it down to a includePartial() call.
This includePartial() automatically calls a data function that returns a struct containing a few text fields and a query result. But when the data was sent to the partial view, the query was missing: actually, some of it's fields were merged in the data structure.
Here is the partial view data function:
and the partial view just dumps the "arguments" variable:
Here is the result of the dump:
I would have expected to see the query, but instead find one of the rows merged into the structure.
If I modify the controller code as follow:
I get:
Did I miss something or is it indeed a bug?
The text was updated successfully, but these errors were encountered: