Closed (fixed)
Project:
Paddle Menu Manager
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2013 at 07:29 UTC
Updated:
25 Mar 2013 at 14:50 UTC
Overview of menu items in menu has to have the following items:
Comments
Comment #1
isolate commentedDependant on #1933114: Show the menus of the current language in the management menu
Comment #2
isolate commentedComment #3
isolate commentedComment #4
pfrenssenStarting on review.
Comment #5
pfrenssenReview:
Passing arguments to form
Do not retrieve your form arguments from the 'args' in the form state, but pass them as function arguments, like this:
Dummy menu item
Trailing spaces in action links
Don't append spaces to the action link titles. If you need spacing between these links this can be done by either formatting them as table cells, or as an unordered list.
Form submit not tested
The actual submitting of the form is not covered by the test suite. Try to add at least 2 items to a menu and changing the order, save, reload the form to see if the order is preserved.
Comment #6
pfrenssenComment #7
isolate commentedComment #8
pfrenssenReviewing.
Comment #9
pfrenssenThe form submit test is still missing, and I found one minor issue. For the reset everything is looking good. I will fix these problems myself and then merge the branch, leaving this assigned to me for the moment.
Passing arguments to form
There is one instance left where the passed-in variables are not used.
Comment #10
pfrenssenWhile writing the test I have encountered this notice:
Comment #11
pfrenssenFixed remarks from #9 and #10, and expanded the test coverage, but the test has discovered a problem in the sorting of the menus: when two menus are added at the same depth and their order reversed, the menus pop back to their original place when the form is submitted. The weights have been set correctly in the database, they just appear in the wrong order. This now causes two tests to fail.
Comment #12
isolate commentedComment #13
isolate commentedUsed the core menu now. Seems to work like a charm.
Fixed the tests aswel, some obsolete tests were done to check for the default order, this is not a case since the menu items are being sorted alphabetically so when using random strings to name your menu items, this will be obsolete.
Comment #14
pfrenssenReviewing.
Comment #15
pfrenssenReview:
Attribute core functions
You have now used modified versions of core functions, which is great as this is solid code. If you do this, it is considered proper to attribute this in the function's docblock. This helps other people understand where this code is coming from. Also describe briefly what is different to the core functions, and an @see line for Doxygen parsing. Example:
Code duplication
The function
paddle_menu_manager_menu_overview_form_submit()seems to be identical tomenu_overview_form_submit(). I did not compare every line in detail, but if they really are identical you can removepaddle_menu_manager_menu_overview_form_submit()and have your form call the original submit handler. You can do this by adding the following line to the form builder:Add a second test for inverse sorting with weights
It is a good point that the initial menu order test is no longer valid as menu items are shown in alphabetical order now. We do need another test now to make sure that the order actually changes when the form is submitted, because if it would remain alphabetical there is a 50% chance that the test will pass. I suggest adding a test that sets the weights first so that the first item has weight 0 and the second weight 1, and testing the result.
Don't use <front> for the placeholders
Currently all links that point to the frontpage are marked as 'Placeholder'. It would be better if they would get the type 'Frontpage' instead. We should detect the actual path "/menu-dummy" for the placeholder pages. Instead of the path we should show the text "no url BLANCO" according to the wireframes. I just talked with cyberwolf about this and he suggests to use this phrase for now, we will change this later to something more fitting.
Change page title
The page title is hard coded to "Menu". This should instead show the name of the menu that is being edited. You can fix this easily by adding these two lines to the hook_menu() configuration:
Comment #16
pfrenssenI've addressed some of these remarks:
I also added some functionality:
Comment #17
isolate commentedFixed the code duplication of the submit handler and the documentation for the core functions we took.
Comment #18
pfrenssenLooking good! Has been merged in 7.x-1.x. Awesome work, thanks!