Menu item block module creates block per menu link items for menus.
You can place one menu item block on drupal.

Project page : https://www.drupal.org/sandbox/nextaeon.kr/2328897
Git : git clone --branch 7.x-1.x git://git.drupal.org/sandbox/nextaeon.kr/2328897.git menu_item_block

Files: 
CommentFileSizeAuthor
menu_item_block_screenshot.png32.07 KBbarami

Comments

barami’s picture

Issue summary:View changes
barami’s picture

Issue summary:View changes
PA robot’s picture

Status:Needs review» Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

IcreonGlobal’s picture

There is one issue reported by Coder module in menu_item_block.admin.inc

severity: normalLine -1: @file block missing

See https://www.drupal.org/node/1354#files for more details.

Thanks

barami’s picture

Issue summary:View changes
barami’s picture

Status:Needs work» Needs review

@IcreonGlobal Thanks for review.

I fixed and tested with coder module.

pkamerakodi’s picture

Hi,

Thanks for the contribution, actually i am really interested in using this function is some of my works. I would spend time testing and playing around it with. Mean while some small suggestions if you like to update.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.

No duplication
Not really sure found couple of modules which helps in creating menu blocks. Could you plese list of the differences on how is this module different from what currently exits in the drupal.org

Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
No: Need more briefing in the read me txt
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
YES
Coding style & Drupal API usage

1) Implement a unistall hook to clear out used variables

2) Are you sure about this line $block['menu_link'] = $link; becuase i dont see this element as per documentation (https://api.drupal.org/api/drupal/modules!block!block.api.php/function/h...)

3) Always better to use renderable array

$block['content'] = theme('menu_item_block', array('menu_link' => $link)); instead of using this way $block['content'] = array(
'#theme' => 'menu_item_block',
'#menu_link' => $link,
);

4) Missing hook_help

Prajwal

pkamerakodi’s picture

Status:Needs review» Needs work
barami’s picture

@pkamerakodi Thanks for review.

To explain why assign $block['menu_link'] variable, It's purpose is providing extendibility to module.
For example. When you want to alter menu item block in other modules(attach image or icon, etc), You can $data['menu_link'] in hook_block_view_alter implementations.

So, I will change code to use renderable array, and no need to assign $block['menu_link'] variable.

Thanks

barami’s picture

About no duplication

I have a menu containes several links. But i needed to place only one menu link as block in region. I seached several options for using this feature when site building. But many menu block modules are convert menu to block. (Also i seached both bean or boxes plugins.) There are not for one menu link item.

barami’s picture

Status:Needs work» Needs review

Fixed #2328931-7: [D7] Menu item block and coder test completed.

joris_lucius’s picture

Assigned:Unassigned» joris_lucius

Assigned to myself for manual code review.

joris_lucius’s picture

Assigned:joris_lucius» Unassigned
Status:Needs review» Needs work

Hello barami,

Here you can find my review and thoughts about the module.

Pareview results:

FILE: menu_item_block.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
8 | ERROR | Function comment short description must be on a single line,
| | further text should be a separate paragraph
--------------------------------------------------------------------------------

FILE: menu_item_block.module
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
15 | ERROR | Case breaking statements must be followed by a single blank line
75 | ERROR | Missing parameter type at position 1
78 | ERROR | Data type of return value is missing
--------------------------------------------------------------------------------

Manual review:

There seems to be alot of "strange" use of the English language. I saw you are from Korea but perhaps you can check all strings.
For example the readme says:

  -- SUMMARY --

Menu item block module creates block per menu link items for menus.
You can places one menu item block on drupal.

-- CONFIGURATION --

* Configure menus in Administration » User Interface » Menu item block.
   - Selects menu to create block per menu link items.

* You can see blocks name starts with 'Menulink:' in blocks.

Reading that was pretty confusing to me.

Generate block info arrays for links of given menu..
On line 73 you got a double end point.

Besides those 2 minor issues I did not see any problems with the code.

Although if this is used on a large menu it could generate alot of blocks.
Is it an idea to place a checkbox at a menu item and generate a block of it instead of a whole menu?
This will allow existing sites to use your module if they want to place a single (or a few) menu links on other places besides the normal menu.

PA robot’s picture

Status:Needs work» Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.