Download & Extend

Minor documentation correction required.

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

Issue Summary

API page: http://api.drupal.org/api/drupal/core!includes!common.inc/function/drupal_add_js/8
API page: http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_js/7

On the "parameters" paragraph of the documentation, the first line describing the the $data parameter should be (changes/corrections underlined):

$data: (optional) If given, the value depends on the $options[type] parameter:

instead of:

$data: (optional) If given, the value depends on the $options parameter:

P.S.:Since I am relatively new in Drupal development please double-check the correction above before you fix it.

Comments

#1

Version:7.x-dev» 8.x-dev
Issue tags:+needs backport to D7

We need to consider D8 first.

#2

Status:active» fixed

Seems to be fixed now.

#3

I don't see how it is fixed. It looks the same to me. Please explain so I won't reopen issue without a reason.

#4

Status:fixed» active

Sorry I read the issue description wrong.

#5

Assigned to:Anonymous» mjonesdinero
Status:active» needs review

attached is the solution on d8

AttachmentSizeStatusTest resultOperations
minor_documentation_correction-1821024-5.patch630 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 46,226 pass(es).View details

#6

Status:needs review» reviewed & tested by the community

#5 looks good to me. Patch applys well and changes are made like in issue summary.

#7

Status:reviewed & tested by the community» needs work

Good catch! It needs to say $options['type'] though, not $options[type].

#8

hope thats ok now

AttachmentSizeStatusTest resultOperations
minor_documentation_correction-1821024-8.patch632 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 46,243 pass(es).View details

#9

Status:needs work» needs review

#10

Good catch! It needs to say $options['type'] though, not $options[type].

Actually if the options parameter is a string, then it will be interpreted as the type:

$options: (optional) A string defining the type of JavaScript that is being added in the $data parameter ('file'/'setting'/'inline'/'external'), or an associative array.

So saying $options['type'] isn't always right.

We could say something like

(optional) If given, the value depends on the $options parameter, or $options['type'] if $options is passed as an associative array.

#11

Status:needs review» needs work

#12

Assigned to:mjonesdinero» dermario

Ok you are right and your sentence is more precise.

AttachmentSizeStatusTest resultOperations
minor_documentation_correction-1821024-12.patch697 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 46,233 pass(es).View details

#13

Status:needs work» needs review

#14

Status:needs review» needs work

The last submitted patch, minor_documentation_correction-1821024-12.patch, failed testing.

#15

Status:needs work» needs review

#12: minor_documentation_correction-1821024-12.patch queued for re-testing.

#16

Assigned to:dermario» jhodgdon
Status:needs review» reviewed & tested by the community

Looks good, thanks! I'll get this committed sometime soon.

#17

Sorry for the delay in committing this -- there's a big Views sprint going on and commits are delaying their patch reviews, so postponing a few days.

#18

Assigned to:jhodgdon» Anonymous
Status:reviewed & tested by the community» fixed

Thanks again! Committed to 8.x and 7.x.

#19

Status:fixed» closed (fixed)

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

nobody click here