Download & Extend

hook_schema() doc should state that database tables are auto-created

Project:Drupal core
Version:7.x-dev
Component:documentation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:needs backport to D7, Novice, Quick fix

Issue Summary

The current api doc for hook_schema() does not mention at all that the database tables returned by implementations will be automatically created. Yes, everyone KNOWS that. Except those who don't. Strangely, the doc for hook_install() actually provides this information, but it really should be in the hook_schema doc as well.

(Will roll a patch.)

Comments

#1

Assigned to:sven.lauer» Anonymous
Status:active» needs review

And a patch.

AttachmentSizeStatusTest resultOperations
doc-hook_schema-autoloaded-1312844-1.patch1.32 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch doc-hook_schema-autoloaded-1312844-1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.View details

#2

Status:needs review» reviewed & tested by the community

Thanks, this looks like a good addition to the docs! I also verified by looking at module_enable() and drupal_uninstall_modules() that the doc is correct about when things happen.

#3

#4

Status:reviewed & tested by the community» needs work

The last submitted patch, doc-hook_schema-autoloaded-1312844-1.patch, failed testing.

#5

Status:needs work» needs review

Ah, I guess this patch conflicted with the one in #1307062: install file hooks should state whether module code is available. Re-rolling.

(If the testbot is happy, I'll set this back to RTBC, as nothing has changed.)

AttachmentSizeStatusTest resultOperations
doc-hook_schema-autoloaded-1312844-5.patch1.34 KBIdlePASSED: [[SimpleTest]]: [MySQL] 36,870 pass(es).View details

#6

Status:needs review» reviewed & tested by the community

#7

Version:8.x-dev» 7.x-dev

Thanks! Committed to 8.x. Leaving RTBC for 7.

#8

#9

Status:reviewed & tested by the community» fixed

Committed and pushed to 7.x. Thanks!

#10

Status:fixed» needs work

+ * creation and alteration of the supported database engines *
  * See the Schema API Handbook at http://drupal.org/node/146843 for

Did someone type backspace when they meant to type a period?... Strange, they aren't even close to each other on the keyboard :)

#11

Version:7.x-dev» 8.x-dev

Whoops.

#12

Issue tags:+Novice

Whoops indeed. At least three of us missed that. Thanks David!

Good novice issue to fix that problem...

#13

Status:needs work» needs review

Since patch from comment#5 was already committed, this patch corrects only comment #10.

AttachmentSizeStatusTest resultOperations
doc-hook_schema-autoloaded-1312844-13.patch712 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 36,910 pass(es).View details

#14

Status:needs review» reviewed & tested by the community

Looks good, thanks :)

#15

After committing, this needs to be D7 / to be ported, and a patch made combining #13 and #5. Thanks!

#16

I think #5 was already committed to D7, actually? (In which case this followup can just go into both D7 and D8 at the same time.)

#17

True. :)

#18

#19

Status:reviewed & tested by the community» needs work

The last submitted patch, doc-hook_schema-autoloaded-1312844-13.patch, failed testing.

#20

Status:needs work» needs review

#13: doc-hook_schema-autoloaded-1312844-13.patch queued for re-testing.

#21

Status:needs review» needs work

The last submitted patch, doc-hook_schema-autoloaded-1312844-13.patch, failed testing.

#22

Status:needs work» needs review

Re-rolled for D8 core dir change - 11/1/11

AttachmentSizeStatusTest resultOperations
doc-hook_schema-autoloaded-1312844-22.patch732 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 33,765 pass(es).View details

#23

Status:needs review» reviewed & tested by the community

Looks good, thanks for fixing (and re-rolling the fix for) my oversight!

This will need a re-re-roll for D7 once committed.

#24

Version:8.x-dev» 7.x-dev

Committed/pushed to 8.x, thanks! Moving to 7.x.

#25

#26

Issue tags:+Quick fix

Thanks, looks like #13 is good for D7. Not very controversial to apply it. :)

#27

Status:reviewed & tested by the community» fixed

Committed and pushed to 7.x. Thanks!

#28

Status:fixed» closed (fixed)

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

nobody click here