#572 open
Matt Jones

Overriding nested params drops surrounding attrs

Reported by Matt Jones | December 7th, 2009 @ 02:09 AM | in Beyond Hobo 1.0

Ran across this today; it's a tricky one to track down. I've attached a sample app that demonstrates the behavior.

Essentially, somehow the act of nesting tags to get access to a nested param is dropping some attributes of the surrounding tags. The relevant example here in the attached app is in app/views/pages/new_for_project.dryml. If you start the app up, log in as the admin (admin@example.com, pw: 123456) and try to create a new page for "Some Project", you'll see the name input field changed to "FOO" (as specifed), but the Project field has reappeared!

Since the field-list in new-for-project-page is passing skip="project", this is a little odd...

Deleting the nested params in new_for_project.dryml makes the project field vanish again.

Comments and changes to this ticket

  • Matt Jones

    Matt Jones December 7th, 2009 @ 02:32 AM

    As further evidence, note that adding skip="project" to the field-list tag in new_for_project.dryml fixes the issue.

  • Tom Locke

    Tom Locke December 7th, 2009 @ 01:47 PM

    • State changed from “new” to “open”

    Any DRYML bugs still in at this stage can be v difficult to track down. Is this enough of a corner-case that we can get away with making in post 1.0? (Sorry haven't looked closely, just firing off the question that popped into my head)

  • Bryan Larsen

    Bryan Larsen December 7th, 2009 @ 04:02 PM

    unless of course the problem is one of the changes I made recently. The most likely is #495, although at a quick glance it looks ok...

  • Matt Jones

    Matt Jones December 7th, 2009 @ 04:49 PM

    It looks more like an issue with the handling of the structure built by param_tag in template.rb; it seems like the behavior that enables this to work:

    <foo: some-attr="y" />
    

    is zapping attributes off the original tag if they aren't declared in the parameter version. Tom, can you point me towards where the DRYML builder gets applied to the existing DRYML? It's probably as simple as special-casing {} to mean "whatever attribute was there before".

  • Tom Locke

    Tom Locke December 8th, 2009 @ 02:09 PM

    Matt - not exactly sure what you're asking for. I'll tell you these DRYML bugs are v v hard : /

  • Matt Jones

    Matt Jones December 14th, 2009 @ 08:29 PM

    Here's the situation in more detail:

    • the autogenerated form tag sets up the field-list with fields="name,project"

    • the autogenerated page tag (new-for-project) sets skip="project" on the field-list param tag

    • the page uses nested param tags to get at name-view, which apparently drops new-for-project's contribution on the floor

    I'll see if I can get the dryml-tracing thing up and running to run this down further, but it does seem like a pretty severe issue since it affects practically any use of nested param tags.

    @Tom: no kidding. I think that statement started to sink in after climbing up 120 frames in the call stack... :)

  • Tom Locke

    Tom Locke December 16th, 2009 @ 10:19 PM

    Thanks Matt - I will take a look

  • Owen

    Owen January 10th, 2010 @ 07:31 PM

    • Assigned user changed from “Tom Locke” to “Bryan Larsen”

    Bryan, perhaps you can take a look?

  • Tom Locke

    Tom Locke January 11th, 2010 @ 02:56 PM

    Apologies for not finding the time to look at this yet.

    Although it's definitely a meaningful bug, I might observe that anything that got spotted this late in the day is not effecting most people. I think at a pinch we could let this slide for 1.0 and put it top of the list for 1.0.1

    Thoughts?

  • Owen
  • Bryan Larsen

    Bryan Larsen January 30th, 2010 @ 02:56 PM

    • Milestone changed from Hobo 1.0 - Final to Beyond Hobo 1.0

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Attachments

Tags

Referenced by

Pages