Possible routing bug in Hobo 2.0.0.pre3

15 views
Skip to first unread message

Ignacio Huerta

unread,
Sep 30, 2012, 6:22:24 AM9/30/12
to hob...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've met this error while testing a new record validations:

Hobo::Error (new style url /projects does not match old style url
/projects/. obj: #<Project id: nil, name: "", description: "",
start_date: nil, end_date: nil, place: "", created_at: nil,
updated_at: nil>. args: []. backtrace:
["/home/ignacio/Trabajos/2_Proyectillos/Hobo/hobo/hobo/lib/hobo/controller/model.rb:412:in
`destination_after_submit'",
"/home/ignacio/Trabajos/2_Proyectillos/Hobo/hobo/hobo/lib/hobo/controller/model.rb:608:in
`create_response'"


Expected behaviour
- ------------------
Render the form again showing the validation errors


How to reproduce
- ----------------
- - Create a new app with the latest Hobo code from master
- - Create a simple model like "project" with a few fields
- - Add "required" to the name field
- - Go to the new page form and leave all fields empty
- - Click "create"

Before I waste a lot of time digging on this: does anyone have any
idea where this error might come from?

Regards,
Ignacio

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBoHWAACgkQBPlUJ6RHaOSwnQCfalea6vOScpTrbl8XKYBfkgiI
tvkAn3rLiIM+TTbfzqBnju8nRp7Ml6kl
=O4VP
-----END PGP SIGNATURE-----

Bryan Larsen

unread,
Sep 30, 2012, 8:00:37 AM9/30/12
to hob...@googlegroups.com
That's not particularly surprising. Routing was refactored completely
for 2.0.0.pre1. If you look at your hobo_routes.rb file you will see
both the new style routes and the old style routes. Your code is
erroring on a snippet of code that exists just to double check that
the two styles of routes are ending up with the same results.
Eventually the old style routes will disappear, along with your error,
but that check is there to ensure that errors are detected early and
obviously rather than late and subtly.

In your case, it looks like it's more of a false positive. It's
saying that /projects/ is not the same as /projects, which is only
partially true. In practice, these two routes are identical.

You can disable the old-style routes by setting
`config.hobo.dont_emit_deprecated_routes`, so that will fix your
problem for now while I dig deeper for a real solution.

Bryan
> Teléfono: 0034 645 70 77 35
> Email realizado con software libre
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBoHWAACgkQBPlUJ6RHaOSwnQCfalea6vOScpTrbl8XKYBfkgiI
> tvkAn3rLiIM+TTbfzqBnju8nRp7Ml6kl
> =O4VP
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups "Hobo Dev" group.
> To post to this group, send email to hob...@googlegroups.com.
> To unsubscribe from this group, send email to hobodev+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hobodev?hl=en.
>

Ignacio Huerta

unread,
Sep 30, 2012, 1:45:41 PM9/30/12
to hob...@googlegroups.com, Bryan Larsen
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, thank you very much for the explanation.
`config.hobo.dont_emit_deprecated_routes = true` works great :).

By the way, I've started work on making the agility tests pass with
bootstrap (and look nice in the process). I've created a branch copying
the "integration_tests/agility" to "integration_tests/agility_bootstrap"
as you suggested:
https://github.com/iox/hobo/tree/integration_tests_agility_bootstrap

Regards,
Ignacio

El 30/09/12 14:00, Bryan Larsen escribi�:
> ------------------
> Render the form again showing the validation errors
>
>
> How to reproduce
> ----------------
> - Create a new app with the latest Hobo code from master
> - Create a simple model like "project" with a few fields
> - Add "required" to the name field
> - Go to the new page form and leave all fields empty
> - Click "create"
>
> Before I waste a lot of time digging on this: does anyone have any
> idea where this error might come from?
>
> Regards,
> Ignacio
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Hobo Dev" group.
>> To post to this group, send email to hob...@googlegroups.com.
>> To unsubscribe from this group, send email to hobodev+u...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/hobodev?hl=en.
>>
>

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBohUUACgkQBPlUJ6RHaOQ0+ACg1E5RfWANdTTBMz0kLeHHCPU6
xaAAn3CFdHucUUvauRsZN1kpBKy2FbkO
=612P
-----END PGP SIGNATURE-----

Bryan Larsen

unread,
Sep 30, 2012, 2:07:43 PM9/30/12
to Ignacio Huerta, hob...@googlegroups.com
On Sun, Sep 30, 2012 at 1:45 PM, Ignacio Huerta <ign...@ihuerta.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ok, thank you very much for the explanation.
> `config.hobo.dont_emit_deprecated_routes = true` works great :).
>
> By the way, I've started work on making the agility tests pass with
> bootstrap (and look nice in the process). I've created a branch copying
> the "integration_tests/agility" to "integration_tests/agility_bootstrap"
> as you suggested:
> https://github.com/iox/hobo/tree/integration_tests_agility_bootstrap
>

Excellent. It would be really nice to make hobo_bootstrap the default
theme for 2.0. Don't be afraid to add more tests while you're
playing there. :)

thanks,
Bryan

Bryan Larsen

unread,
Oct 1, 2012, 9:22:47 AM10/1/12
to hob...@googlegroups.com
Ironically, the bug you discovered was actually a bug in the *old*
routes, not the new ones. I've pushed a fix.

Could you please remove config.hobo.dont_emit_deprecated_routes from
your apps, at least for the time being, so we can find any similar
bugs?

thanks,
Bryan


On Sun, Sep 30, 2012 at 6:22 AM, Ignacio Huerta <ign...@ihuerta.net> wrote:
> Teléfono: 0034 645 70 77 35
> Email realizado con software libre
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBoHWAACgkQBPlUJ6RHaOSwnQCfalea6vOScpTrbl8XKYBfkgiI
> tvkAn3rLiIM+TTbfzqBnju8nRp7Ml6kl
> =O4VP
> -----END PGP SIGNATURE-----
>

Ignacio Huerta

unread,
Oct 2, 2012, 1:16:57 AM10/2/12
to hob...@googlegroups.com, Bryan Larsen
Hi,

I just removed config.hobo.dont_emit_deprecated_routes, tested again
and the bug is gone :).

I'll keep you updated if it comes up somewhere else.

Regards,
Ignacio

El 01/10/12 15:22, Bryan Larsen escribi�:
> Ironically, the bug you discovered was actually a bug in the *old*
> routes, not the new ones. I've pushed a fix.
>
> Could you please remove config.hobo.dont_emit_deprecated_routes
> from your apps, at least for the time being, so we can find any
> similar bugs?
>
> thanks, Bryan
>
>
> On Sun, Sep 30, 2012 at 6:22 AM, Ignacio Huerta
> <ign...@ihuerta.net> wrote: Hi,
>
> I've met this error while testing a new record validations:
>
> Hobo::Error (new style url /projects does not match old style url
> /projects/. obj: #<Project id: nil, name: "", description: "",
> start_date: nil, end_date: nil, place: "", created_at: nil,
> updated_at: nil>. args: []. backtrace:
> ["/home/ignacio/Trabajos/2_Proyectillos/Hobo/hobo/hobo/lib/hobo/controller/model.rb:412:in
>
>
>
`destination_after_submit'",
> "/home/ignacio/Trabajos/2_Proyectillos/Hobo/hobo/hobo/lib/hobo/controller/model.rb:608:in
>
>
>
`create_response'"
>
>
> Expected behaviour ------------------ Render the form again
> showing the validation errors
>
>
> How to reproduce ---------------- - Create a new app with the
> latest Hobo code from master - Create a simple model like
> "project" with a few fields - Add "required" to the name field - Go
> to the new page form and leave all fields empty - Click "create"
>
> Before I waste a lot of time digging on this: does anyone have any
> idea where this error might come from?
>
> Regards, Ignacio
>
>>
>> -- You received this message because you are subscribed to the
>> Google Groups "Hobo Dev" group. To post to this group, send
>> email to hob...@googlegroups.com. To unsubscribe from this
>> group, send email to hobodev+u...@googlegroups.com. For
>> more options, visit this group at
>> http://groups.google.com/group/hobodev?hl=en.
>>
>

--
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Reply all
Reply to author
Forward
0 new messages