Menu Export is a Drupal 7 module to export menus easily. This module aslso provides an import function.

A similar module exists, it's Menu Import, the biggest difference is on the exported result file.
Menu Export creates an StdClass Object and the other module creates a text file with json inside.

The page project

https://www.drupal.org/sandbox/max62fr/2337365

The git clone command

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/max62fr/2337365.git menu_export

The Project Application Review Link

http://pareview.sh/pareview/httpgitdrupalorgsandboxmax62fr2337365git-0

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxmax62fr2337365git

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.

max62fr’s picture

Status: Needs work » Needs review

Seems to pass the pareview.sh tool now ...

nitesh pawar’s picture

Issue summary: View changes

Replaced ssh link to http

max62fr’s picture

Issue summary: View changes
klessou’s picture

Status: Needs review » Reviewed & tested by the community

Installed and used in my last Drupal Project, Thx Max62fr, it was really helpfull to build an homemade deploy module.

drizztt24’s picture

Used easily in my deployment of new project. Nice.

myhemant’s picture

Used in my project, Nice module. It would be great if you added the global Import menu button on menu listing page.

pushpinderchauhan’s picture

Status: Reviewed & tested by the community » Needs work

@max62fr, thankyou for your contribution.

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. None.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
(*) May Be: Does not cause module duplication and fragmentation.
I am not sure how your module aim is different from Menu Export/Import module. Menu Export/Import is already gives both features that you are providing, just changing the export file syntax doesn't make sense to me. If you are providing some additional feature or it is more useful from performance prospective or anything else then elaborate the same on your project page. If you give genuine reasons, it would help other people why they prefer your module instead Menu Export/Import.

I still feel in what scenario this module is preferable instead of Menu Export/Import. I am sure you gone through some business use cases where you get such type of requirement, do share here.

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
Yes: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. (*) You missed a t() on the #title in menu_export_list_export_form() on line 40.
  2. hook_help() is missing in your module.
  3. (+) menu_export_menu_import(): I'm not sure, why are you not providing import functionality in admin interface. Instead you are giving some tips and example in README file to import that cause a site admin who don't know how to write php code, can't import this menu. There is a possibility, i'm missing something here so please add your comment on this. Again
  4. (*) menu_export_export_form(): $menu_name = arg(4); is not a recommended approach.
    Instead of
    $items['admin/structure/menu/manage/%/export'] = array(
        'title' => 'Menu export',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('menu_export_export_form'),
        'access arguments' => array("administer menu"),
        'type' => MENU_LOCAL_TASK,
        'weight' => 11,
      );
    
    function menu_export_export_form($form, &$form_state) {
      $menu_name = arg(4);
    
    }
    

    Use following (page arguments):

    $items['admin/structure/menu/manage/%/export'] = array(
        'title' => 'Menu export',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('menu_export_export_form', 4),
        'access arguments' => array("administer menu"),
        'type' => MENU_LOCAL_TASK,
        'weight' => 11,
      );
    
    function menu_export_export_form($form, &$form_state, $menu_name) {
        $elements = menu_tree_all_data($menu_name);
    }
    

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)

Thanks Again!

max62fr’s picture

@er.pushpinderrana Thank you, your review is really helpful. I'm gonna fix everything very soon.
@myhemant In the meantime, I will provide an import interface.

max62fr’s picture

Status: Needs work » Needs review

Hi.
Thanks again for the review.

All change done.
The description page and hook_help text will be updated very soon.

gaurav.pahuja’s picture

Status: Needs review » Needs work
StatusFileSize
new8.01 KB
new3.16 KB

Automated Review

Yes.

http://pareview.sh/pareview/httpgitdrupalorgsandboxmax62fr2337365git-0
Best practice issues identified by pareview.sh / drupalcs / coder. Please don't copy/paste all of the results unless they are short. If there are a lot, then post a link to the automated review and mention that problems should be addressed.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No. Similar module exists. https://www.drupal.org/project/menu_import : Does not cause module duplication and fragmentation.
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
Yes: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. (*) Major finding

    While importing a menu into the system, validation should be placed inside menu_export_import_form_validate instead of menu_export_import_form_submit.

    I tried importing an already existing menu and got an error message. But my Menu code has been removed.

    Screenshots attached.
    Menu Export 1

    Menu export 2

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

max62fr’s picture

Status: Needs work » Needs review

Thanks gaurav.pahuja !

All changes is done, the "hook_form_validate" function is inspired by the view module.
I've also added the support of the disabled option in a menu link.

joachim’s picture

Status: Needs review » Needs work

> A similar module exists, it's Menu Import, the biggest difference is on the exported result file.
Menu Export creates an StdClass Object and the other module creates a text file with json inside.

If that's the biggest difference then you should really consider joining forces with that module rather than creating duplication.

What's the benefit of having an object over json? Surely if you're using it to export/import, the format is immaterial as long as you can copy-paste it from one site to another.

max62fr’s picture

Status: Needs work » Needs review

I've already explained why those two module are similar but complementary.
"We would recommend you to use Menu Export if you need something to deploy faster your project. Nethertheless you should probably have a look to Menu Export/Import if you need something readable and understandable by non-tech person."

We also plan to add those kind of features :

Create a way to be able to revert any changes on a menu, something like the revert feature provided by view.

  • Create a way to be able to revert any changes on a menu, something like the revert feature provided by view.
  • Make this module compatible with drush :
    • drush menu-import
    • drush menu-export
    • drush menu revert
    • and so forth ...

We made that module also because, we use a lot that kind of feature from view and panel to deploy a website automaticly from scratch.
We feel like it's even more covenient, to manipulate php code like view and panel do.

Plz note : Menu Export/Import doesn't use a JSON structure at all.

joachim’s picture

> We would recommend you to use Menu Export if you need something to deploy faster your project.

Why is using Menu Export faster?

pushpinderchauhan’s picture

Status: Needs review » Postponed (maintainer needs more info)

Make this module compatible with drush :

Menu Export/Import also compatible with Drush. Still not convinced from your explanation how your module is faster from existing one, even faster doesn't make any sense, as it is just export/import task.

Nethertheless you should probably have a look to Menu Export/Import if you need something readable and understandable by non-tech person.

What do you mean here from non-tech person? Is your module not useful for Non Technical people?

Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition.

PA robot’s picture

Status: Postponed (maintainer needs more info) » 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.