There are a few direct links in code documentation that point to http://api.drupal.org. Currently, they are all pointing to the D7 version. These need to be updated to point to the D8 version.

Comments

duellj’s picture

Status: Active » Needs review
StatusFileSize
new6.57 KB

And here's the patch.

David_Rothstein’s picture

This looks good, and I verified that all the URLs work as expected:

-    'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7',
+    'website' => 'http://api.drupal.org/api/drupal/core%21includes%21ajax.inc/group/ajax/8',

Would it be cleaner (and a bit more future-proof) to use http://api.drupal.org/api/group/ajax/8 here instead? It seems to go to the same place.

jhodgdon’s picture

Status: Needs review » Needs work

#2 - yes!

To point to the Form API reference, just use the file name forms_api_reference.html instead of the URL.

To point to a topic, just use the topic's machine name, such as "ajax", instead of the URL.

If there are any other places in core that have links to api.drupal.org, they should all be removed.

jhodgdon’s picture

Sorry, to clarify: #3 only applies to documentation headers. If there are links being made in Help, then they need to have the URL, and the URL suffix needs to have /8 on it to be "future-proof".

And for URLs with #suffix on them, I would reword so that the on-page reference isn't needed. Just say "See the @link forms_api_reference.html Form API reference @endlink for more information." or something like that.

duellj’s picture

Status: Needs work » Needs review
StatusFileSize
new8.05 KB

Thanks jhodgdon. All of the @links are to the forms_api_reference.html page, so updated all of those (and found a couple more that needed shortening). Also removed the #tree link and added the more generic see @link.

jhodgdon’s picture

Status: Needs review » Needs work

Mostly good! A couple of things to fix:

a) In the first hunk in the patch, leave off the /8 -- just put in the file name:

+ *   More information is available in the @link forms_api_reference.html/8 Form
+ *   API Reference @endlink

Also, @link ... @endlink should always be all on one line. If that makes it go over 80 characters, start the @link on a new line.

b)

+++ b/core/modules/field/field.api.php
@@ -691,7 +691,7 @@ function hook_field_is_empty($item, $field) {
  * hook_field_widget_info().
  *
  * Widgets are
- * @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html Form API @endlink
+ * @link forms_api_reference.html Form API @endlink

I think that @link...@endlink can be moved up to the previous line and not exceed 80 characters? If not, some of the words from the next line can be moved up.

c) It would be good if someone could check all the replaced URLs and make sure they all go to the correct place. Many of them redirect, which is probably OK (the URLs in the files are simpler than the ones they are redirected to), but someone should test them. I didn't do that yet.

duellj’s picture

Status: Needs work » Needs review
StatusFileSize
new8.01 KB

Thanks for the review jhodgdon. Fixed issues from #6, except for 'c', which I'm not sure how to check the URLs.

jhodgdon’s picture

(c) - check the URLs == copy the URL from the patch, paste it into your browser's URL bar, and verify it goes to the correct function/class/topic documentation as intended. :)

duellj’s picture

Oh, sorry, I thought you meant checking the short @link urls, which I wasn't sure how to do. I've checked all of the URLs in the patch, and they indeed to go to the correct topic intended by the documentation.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good! This touches quite a few files, so I'll leave it at RTBC for a few days, and probably commit on Friday the 4th, if there are no issues tagged "avoid commit conflicts" that conflict at that time.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! This has been committed to 8.x.

Status: Fixed » Closed (fixed)

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