Module builder has got to the stage where I think it's ready for other contrib modules to add support for it, allowing developers to quickly set up code for hook implementations.

In order to add support for module builder, views would need to do the following:

1. Add a views.module_builder.inc file. I've attached this :) This implements hook_module_builder_info (details here: #406538: Module Builder Hook)
2. restructure the files in /docs. Each potential destination for hook code should get a file. So since views hooks can go into the module file, a views.inc, or a views.defaults.inc, that's three files. The views.module_builder.inc file will then need tweaking to list these.
3. It would be nice if the opening description of each hook were a single line :)

Comments

joachim’s picture

StatusFileSize
new798 bytes
dawehner’s picture

Project: Views (for Drupal 7) » Module Builder

As far as i understand Earl, views does only integration into drupal core.

For example see http://drupal.org/node/508550#comment-1769594

But I really like it, i just needed it on the train.

joachim’s picture

Title: Addd support for module builder » Add support for module builder
Project: Module Builder » Views (for Drupal 7)

Um, no, this isn't about Views support, it's about module builder support.
Or to put it another way:
"support for views" = views having information about a module's database tables.
"support for MB" = MB having information about a module's hooks.
Maybe I've got my terms the wrong way round? but anwyay, the former is irrelevant here; this issue is about the latter.

Just as views only supports core, so does MB only support core.
I chatted briefly to merlinofchaos about this online and he was open to the idea :)

dawehner’s picture

Did you have uploaded the views hooks? Last time i drush mbdl -ed they got downloaded, too :)

joachim’s picture

Yeah -- I figured rather than wait for modules to support this, I'll just shove in the data into MB for now.

Letharion’s picture

Assigned: Unassigned » merlinofchaos

@merlinofchaos
If you think Views should support this, I could take on this.
Assign to me if yes, or comment/close if no.

joachim’s picture

I've kind of given up on this myself ;)

The support for Views 6--2 with module builder is currently in the code for MB.

What would be good to check is that Views has the standard api.php file to document hooks on Drupal 7. IIRC it doesn't follow the same filename convention as core.

dawehner’s picture

It's currently docs/docs.php and not views.api.php

joachim’s picture

Thought as much.

In D7 core, the standard is node.api.php. So on Views this should be views.api.php.

This would be good to change not just for module builder, but various API sites too.

merlinofchaos’s picture

Assigned: merlinofchaos » Unassigned
Category: feature » task

This one never got onto my radar due to the generally large amount of traffic in the queue. Sorry about that, joachim.

I am not opposed to adding the module_builder.inc file to Views, but it isn't looking like that's really necessary at this time since module builder already has it, and moving it seems like more work than actually benefits anyone.

Anyone want to do the required patch for D7?

joachim’s picture

Agreed; the best thing to do here is just move docs/docs.php to views.api.php for D7. Shall we retitle this issue or make a new one?

dawehner’s picture

@joachim

This would fix everything, right?

joachim’s picture

Yup.

Module builder on D7 already goes looking for MODULE.api.php in module base folders because that's what core does, so it should find views.api.php too.

...

In fact, MB does:

  $system_listing = drupal_system_listing('/\.api\.php$/', 'modules', 'filename');

Though I may change that to use module_list() as the above code then needs a load of mucking about with regexps to actually find module names.

joachim’s picture

Title: Add support for module builder » Move hooks docs to the standard place (and add support for module builder)
Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new41.79 KB

Here's a patch to move the file to views.api.php.

I've put it in the base folder as that's where all core modules put theirs.

dawehner’s picture

Status: Needs review » Fixed

Let's stick with the standards. Commited and pushed.

merlinofchaos’s picture

No, not in the base folder, please. Core loves to litter the base module folder, and it's terrible. Look in system module.

merlinofchaos’s picture

I just moved it back to the docs folder and pushed.

joachim’s picture

Hmm... would be better to fix the standards rather than diverge from them.

(Though I say this; module builder still outputs 'Implementation of...')

merlinofchaos’s picture

Well, re-organizing core would be nice, but is hardly a priority.

views does a lot of things core doesn't do, so sometimes Views uses different standards. One of my standards is "Keep the root directory clean." Core puts .css files in the module root directory. I don't. Nobody has complained about this, either. :)

merlinofchaos’s picture

Also, just because core chose to put its files someplace doesn't really mean it's a standard. That's just the choice core developers made when they did the patch. We must differentiate from "Core does it that way" from "it's a standard" and the latter implies some serious thought about why it's done that way. THe former merely implies that's what they chose at that moment.

Status: Fixed » Closed (fixed)

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