Closed (fixed)
Project:
Panels
Version:
5.x-2.x-dev
Component:
Panel pages
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
9 May 2008 at 12:51 UTC
Updated:
7 Jun 2008 at 05:42 UTC
Jump to comment: Most recent file
panels_page_add_page() returns a drupal_not_found(), if called with an invalid $layout parameter.
Why doesn't it simply fallback to "Choose layout", as if it was called without a $layout parameter? This would be more forgiving to the user and also four lines less code...
(While this is just a minor issue, I just didn't want to forget about it...)
Attached is a small patch changing this.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | panels_page_add_page_3.patch | 1.2 KB | pancho |
| panels_page_add_page.patch | 1023 bytes | pancho |
Comments
Comment #1
panchoComment #2
merlinofchaos commentedIn general, I prefer providing feedback for invalid arguments. I can go either way on this one, mind you, but it can actually be more confusing to get a page you were completely not expecting instead of an error message when an argument is invalid.
Comment #3
panchoOkay, this should be the best approach: If the provided $layout is invalid, I file a warning and unset the layout.
This will become somewhat important as soon as panels_allowed_layouts() is implemented in panels_page.
Comment #4
sdboyer commentedWell...since the use (or not) of panels_allowed_layouts is ENTIRELY up to the client module and it doesn't interfere in the normal editing processes, it won't make much of a difference here unless/until we rewrite panels_page to implement the allowed layouts system.
But, I think that in this case erring on the side of pushing the user to somewhere they might not expect is better than a 404, given that at this point, I think the problem much of Panels' user base is experiencing is NOT the one where they know exactly what to expect from Panels, then get surprised :)
Committed.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.