CVS edit link for vosechu

On a large client project the menu system hosed at about 200 menu links. There is a core patch in the process but by only showing parent menu items we can take the render time of our site from 40s to about 2s. The load time on the page is still about 20 seconds, but that's another day. I've included a form_alter which helps with this for now.

Comments

vosechu’s picture

StatusFileSize
new1.63 KB

Initial project upload

vosechu’s picture

Status: Postponed (maintainer needs more info) » Needs review
vosechu’s picture

StatusFileSize
new4.67 KB
new1.7 KB

Ran this through coder and made a lot of the updates requested from the previous applicant. I'm also providing a patch so that it's hopefully easier to read.

vosechu’s picture

StatusFileSize
new5.63 KB
new2.02 KB

Per recommendation from claar I've wrapped some lines to make them readable. Also added a README.txt with a brief description.

vosechu’s picture

Comparison of modules:

Searching for 'drupal menu admin' did not reveal anything that looked like this module. I suspect that people don't often run into this problem except in the enterprise. Even then, Views can be used to create directories but some people really want to use the menu admin to create blocks using menu block or nice menus so this makes that possible.

The reason this is a module instead of a core patch:

This module does alter the look of the stock menu admin in a way that may not be necessary for all but the largest sites. If it turns out that people love it then it seems like a great thing to add to core, but for now it seems necessary to make it opt-in.

vosechu’s picture

This also includes a non-core implementation of http://drupal.org/node/936046.

vosechu’s picture

Issue tags: +Module review
vosechu’s picture

StatusFileSize
new2.02 KB
new5.67 KB

Ugh, coworker pointed out a subtle bug that prevented fields from being switched into textfields. Also that hidden fields would never work for non-js users even though it renders way faster.

vosechu’s picture

StatusFileSize
new5.48 KB
new1.94 KB

Yeah, probably just going to use this as my CVS account for a little while. Did a couple performance enhancements and made it feel a little more drupaly in my eyes.

avpaderno’s picture

Status: Needs review » Needs work

Hello, and thank you for applying for a CVS account.

As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site; for modules, it should include also a comparison with the existing solutions.

vosechu’s picture

Kiamlaluno: Do I need to resubmit? I don't have access to edit my post.

grendzy’s picture

afaik you can post a revised / expanded motivation message in a comment.

Some further suggestions:
-- your post mentioned this module improved render times - how? which paths are affected? Why does it take 40 seconds to render a page previously?
-- Screenshots of webkit inspector showing before / after would be useful
-- +1 for comparison with existing solutions; if there are none explain that as well

(full disclosure: I work with vosechu)

grendzy’s picture

brief code review:

-- doxygen for hooks is moving to a verb in present tense, e.g. "Implements hook_menu()." (see http://drupal.org/node/1354 )
-- in hook_menu, title shouldn't have t() function
-- The comment "Adds menu item fields to the node form." doesn't seem accurate. There should be no space between the docblock and function declaration.
-- dmenu_admin.module contains some trailing whitespace
-- Since drupal_add_js is called conditionally, I think it would be better to set $preprocess = FALSE.

avpaderno’s picture

@vosechu: You can expand the motivation in a comment, as grendzy reported.

vosechu’s picture

Status: Needs work » Needs review
StatusFileSize
new5.45 KB
new1.93 KB
new69.92 KB
new71.21 KB
new46.41 KB

Expanded motivation message:

Drupal's menu system is absolutely awesome at what it does, especially if you run it in a browser with a fast rendering engine like Webkit. But imagine if you will, a client that uses IE7 and loves to shove everything in the menu system; that table drag is starting to look pretty evil and your client keeps claiming their browser crashes when the hit the menu page!

Dmenu_admin reduces this burdon significantly by only displaying a few elements at a time so that the JS rendering engine has less to do. If you have over 1000 menu items in one list you should absolutely be using this module. If you have over 500 and your clients use IE (and actually use the menuing system I suppose) you should absolutely be using this module.

Dmenu_admin only does two things but they're very important. First, it uses textfields instead of select boxes which cuts down on page load time dramatically (http://drupal.org/node/936046). Secondly, it makes child elements of a menu item 'display: none;' until the expand link on the parent is clicked.

Comparison with other modules:
Not many people have run into this problem yet. Googling did not reveal any modules that do similar things. My guess is that the enterprise users that have run into this problem aren't releasing their modules.

How to use this module:
Turn it on with the Module admin or via drush. No settings are required to configure the module.

Stats:
Menu items: 1,506
Without dmenu_admin:
Load time (Drupal processing): 23 seconds
Render time (JS render/paint): 34 seconds

With dmenu_admin:
Load time (Drupal processing): 17 seconds
Render time (JS render/paint): 2 seconds

To see the admin in action check out 'Primary links.jpg'
To see the load/render times according to webkit check out the 'Load+Render*' jpgs.

vosechu’s picture

StatusFileSize
new1.93 KB
new5.45 KB

Code updated regarding Grendzy's comments.

vosechu’s picture

@kiamlaluno, expanded message posted. I've not been able to get a review of this, is it just too difficult to test accurately do you think? Or maybe too low effect?

mikey_p’s picture

Status: Needs review » Needs work

This doesn't look quite right, it seems that there is a file missing or something, or the menu callback and links to it are incorrect (the menu item's 'page callback' doesn't exist).

vosechu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.77 KB
new5.04 KB

Augh, damnit, you're right. Vestigial function. Attaching new version without the extra hook_menu. I feel like this is getting close to core-patch sized at this point but I know it's not going into core for a lot of reasons. Maybe it's time to do the same thing to the taxonomy admin.

grendzy’s picture

Status: Needs review » Reviewed & tested by the community

I think this meets the CVS requirements. The concerns raised so far (in both the code and motivation) have been addressed.

zzolo’s picture

Status: Reviewed & tested by the community » Fixed

@vosechu, thanks for the application and patience. I have approved you, but would like you to consider the following for this module:

  1. No $Id$ in README.txt or .info file
  2. No @file docblock in .module and .js files
  3.               '<a class="showchild" href="/dmenu-admin/' . $element['#item']['mlid'] .
                  '/' . $element['#item']['menu_name'] . '"> ' .
    

    You should be using l() here.

  4. Though an awesome little fix, its hard to justify this as a whole module. Look at combining with some other general interface improvement module, or create a more general interface improvement module. I actually kind of don't want to accept this as a module as it just adds to the sea of modules that do very little specific things, but I won't go that far. Please consider this, even before making a project out of this module.
  5. Though you output just a bit of HTML, it really should be in a theme function just in case.
  6. Degrade better for non-JS users.

Please read the following resources to make sure you know how to use CVS and the specifics to the Drupal CVS infrastructure, as well as how to be a good module maintainer on Drupal.org. The Drupal community is very large and dynamic; we welcome you as a module maintainer and hope that you embrace and challenge the Drupal community and continue to contribute.

--
Note: Please be patient with the CVS application process. It is all done by volunteers. Our goal is not to be arbitrarily slow or meticulous. Our goal is to get you CVS access and ensure that you are and will become a more responsible Drupal contributor. For a quick reference on what I look for in a code review, please see this article, or read the handbook page on how to review for reference..

vosechu’s picture

Thanks for the fix zzolo and the advice. I think you're right about integrating with a larger module but I appreciate the CVS account.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.