When enabling the module, all HTML features should be enabled by default.
This would seem to be more sensible than having to enable all the features one by one.
Users that don't want a particular feature can still disable it.
Patch forthcoming.

CommentFileSizeAuthor
#2 better-install-1260970-3.patch12.89 KBalanburke

Comments

alanburke’s picture

Title: All HTML5 features should be enabled by default. » All HTML5 features should be enabled by default - Din't use variable_get in hook_install

It turns out that they are - but by using hook_install.
There should be no need for that.

alanburke’s picture

Status: Active » Needs review
StatusFileSize
new12.89 KB

Patch for this attached

ericduran’s picture

I'm all for removing the hook_install I don't like it.

But regarding all features should be enabled by default. I'm not so sure, I think all the module features should be disable by disabled and user should then select which feature they'll like to have enabled.

amateescu’s picture

Status: Needs review » Fixed
alanburke’s picture

But regarding all features should be enabled by default. I'm not so sure, I think all the module features should be disable by disabled and user should then select which feature they'll like to have enabled.

I disagree with this.
When a user enables this module, I would argue that they expect these features by default, and should opt out of they don't need it.
JohnAlbin was suggesting [at the Drupalcon London code sprint] that there should be no opt-out at all.
It a feature is useful enough to make it into this module, then that should be enough - don't let users option out.
It would clean up the code somewhat if that option was removed.

amateescu’s picture

Sorry Eric, I commited the patch before seeing your comment. I agree with John Albin and Alan Burke here, if the user wants html5 stuff and they install this module, they should see the change right away :)

ericduran’s picture

Status: Fixed » Needs work

Changing to needs work because there's a bug in the code. But I'll explain my thoughts behind this before the bug.

I'm still not sure, I get what people are saying, but modules don't just enabled their settings by default thats just mean.

We also change the html.tpl.php that is used, these aren't nice changes to just do without approval from the user.

If we want we can add an enable all feature so anyone could easily toggle on an off the modules settings.

But essentially there's two types of module:
Type 1 - Module that you enabled and it does everything its going to do, and to turn it off you disable the module.
Type 2 - Module you enabled and you get new settings to enable and disable.

Sadly we're the type 2 kind of module, so we really shouldn't enabled all the features by default. It will be like installing views and it enabling the front_page view as soon as you enabled it. Not nice :-)

But back to the bug,

having the variable_get return 1 for the html5_tools_override_views_field_rewrite_elements variable doesn't have the desire effect you would be expecting.

The user will still will need to go to the form and save it in order to get the new Elements available to views.

Changing back to needs Work.

ericduran’s picture

I fix the bug with this commit -- http://drupalcode.org/project/html5_tools.git/commit/73f5976

Sorry but I remove having the views elements overwrite default to 1, This is because it needs to be saved in order to take affect, so having that check-box display checked is wrong and mis-leading.

I'm open to another way around it.

ericduran’s picture

Status: Needs work » Fixed

Marking it as fixed, I'll leave the value checked by default, even thought I don't agree, we'll see what people think.

Thanks for the patches :)

ericduran’s picture

Status: Fixed » Closed (fixed)

Switching to closed, because I like the issue queue being empty ;-) as always feel free to open the ticket if you feel is not fully closed.