Assume any contributed module X (e.g Quiz) on drupal.org (=D.O), or any of its sub-modules Y (e.g Quiz Stats). Any such (sub-)module may depend on one or more other contributed (sub-)modules Z (e.g Charts, disclosure: I'm a co-maintainer), as indicated in the (sub-)module's info file (e.g in the last line of the info file of the Quiz Stats module).

My question: How can I identify all modules X and submodules Y, which depend on module Z?

The question about "Is there a drupal.org API for retrieving the list of available modules?" is somehow related (not a duplicate IMO), but none of the answers there seem to help to find the answer to my question, or am I missing something in those answers?

Note: this question is really about modules "on drupal.org", so I may not even have Drupal installed anywhere ... Think of this question in the context of, for example, a d8rules campaign, where somebody wants to try to find other modules depending on Rules to reach out to the module (co-)maintainers of those other modules (for whatever reason related to such campaign).

  • Pierre what is D.O? – Adrian Cid Almaguer Mar 8 '17 at 22:41
  • @AdrianCidAlmaguer check the edit (link) to D.O. I added. Did I use an abbreviation that is not correct maybe? Something else? BTW, it's D.O., not D.A. (= Drupal Answers, i.e "here"). Make sense? – Pierre.Vriens Mar 8 '17 at 22:49
  • Unless the module is installed on your system, (local) Drupal does not know what module that is. (module requiring entity without it being installed state they need 'entity'. Once it is installed it is named 'Entity API'.) So Drupal cannot resolve this locally. Use drush, it will resolve the dependencies for you. – Neograph734 Mar 11 '17 at 9:25
  • In that case, this is dependent on a database of dependencies: drupal.org/node/1299332 (found in the d.o API question). Since the issue is still open, I'd say no. – Neograph734 Mar 11 '17 at 9:40
  • @Neograph734, interesting link, but an "active" D6 feature request doesn't look like it will become "fixed" any time soon (hoop doet leven ...). but apart from that, if I correctly understand that issue, it's about the other way around, ie to find modules such as Z, starting from X (or Y), While my question is starting from Z, what are the modules X (or Y). Please correct me if I don't interprete that right. – Pierre.Vriens Mar 11 '17 at 9:52
up vote 4 down vote accepted

As was mentioned above the solution could be parsing info files of all projects hosted on drupal.org. You can use this small tool to facilitate the process of obtaining the codebase of Drupal contributed projects.

Below is an example of searching dependencies for Quiz module.

drupal-project-loader -c 5 -b 7.x -d d7_modules -y &&
cd d7_modules && ag 'dependencies\[\] = quiz$' -G \.info$ |
sed 's/\/.*//;s/^/https:\/\/www.drupal.org\/project\//' | uniq | sort

The result:

https://www.drupal.org/project/certificate
https://www.drupal.org/project/certify
https://www.drupal.org/project/civicrm_cert_quiz
https://www.drupal.org/project/cloze
https://www.drupal.org/project/course
https://www.drupal.org/project/elms_features
https://www.drupal.org/project/grouping_question
https://www.drupal.org/project/image_target_question
https://www.drupal.org/project/kalvi_core
https://www.drupal.org/project/mark_word
https://www.drupal.org/project/og_quiz
https://www.drupal.org/project/opigno
https://www.drupal.org/project/opigno_pretest_app
https://www.drupal.org/project/opigno_quiz_app
https://www.drupal.org/project/opigno_quiz_import_app
https://www.drupal.org/project/qq_import
https://www.drupal.org/project/quiz
https://www.drupal.org/project/quiz_ddlines
https://www.drupal.org/project/quiz_drag_drop
https://www.drupal.org/project/quiz_evaluation
https://www.drupal.org/project/quizfileupload
https://www.drupal.org/project/quiz_h5p
https://www.drupal.org/project/quiz_progress
https://www.drupal.org/project/quizrubric
https://www.drupal.org/project/quiz_sentence_drop
https://www.drupal.org/project/quiz_share
https://www.drupal.org/project/quiz_userpoints
https://www.drupal.org/project/quiz_voice_answer
https://www.drupal.org/project/quizwebform
https://www.drupal.org/project/simple_mcq
https://www.drupal.org/project/tincanapi
  • Interesting, merci! Would you mind expanding your answer please to also include a similar result for the "charts" module? If you do, I'll mark your answer right away as accepted also ... – Pierre.Vriens Apr 27 '17 at 11:11
  • @pierre-vriens, it is two-step process. First you download all Drupal 7 modules then search their info files using following regular expression 'dependencies[] = quiz$'. – ya.teck Apr 27 '17 at 11:21

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.