Problem/Motivation

Here is the paragraph in the top-level README.txt file for Drupal 8.2.x:

Drupal contains an extensive API that allows you to add to and modify the
functionality of your site. The API consists of "hooks", which allow modules to
react to system events and customize Drupal's behavior, and functions that
standardize common operations such as database queries and form generation. The
flexible hook architecture means that you should never need to directly modify
the files that come with Drupal core to achieve the functionality you want;
instead, functionality modifications take the form of modules.

Um. Hooks and functions. Really?

There is no mention of classes, plugins, routing, or anything else that really makes up our API these days.

Proposed resolution

I think maybe this paragraph needs an update.

One other thing... I think we should change the api.drupal.org URL that is at the bottom of this section from explicitly being https://api.drupal.org/api/drupal/8 to just https://api.drupal.org -- that will somewhat future-proof the file.

Remaining tasks

Needs patch drafting new paragraph

User interface changes

None needed

API changes

None needed

Data model changes

None needed

Comments

jhodgdon created an issue. See original summary.

andrewhd’s picture

Issue tags: +neworleans2016

I am working to triage this issue.

jdelvillar01’s picture

I am working on triaging this issue

jdelvillar01’s picture

andrewhd’s picture

Issue tags: +needs patch
andrewhd’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Inserted template and formatted jhodgdon's original issue, no UI/API/Model changes seem to be needed for this issue

xjm’s picture

Issue tags: -needs patch +Triaged for D8 major current state

Thanks @AndrewHD and @jdelvillar01; I take it from your comments that you confirmed this is still an issue with the README (which it is indeed). Updating credit.

xjm’s picture

Version: 8.2.x-dev » 8.1.x-dev

As a documentation bugfix, this change is eligible for patch releases.

chishah92’s picture

Assigned: Unassigned » chishah92
chishah92’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

Have updated the readme.txt of drupal 8.2.x according to your suggestions and also have changed to URL in the bottom section for API. Please give suggestions if any.

Thanks!
~Chirag

jhodgdon’s picture

Status: Needs review » Needs work

Thanks! This is a good start. A few problems:

a) The paragraph really needs more modification. The second sentence (see issue summary) starts off by talking about only hooks, which are really not at all central to the current Drupal 8 API. So, it needs a rewrite starting there. The alteration mechanisms available to modules in Drupal 8 are:
- Hooks
- Plugins
- Dependency injection
- Events

b) Several of the lines in the patch end in spaces. You need to remove all end-of-line spaces. Most programming editors have settings for either highlighting or removing end-of-line spaces, and if you plan to continue working on patches for Drupal, one of those settings is very useful.

chishah92’s picture

Status: Needs work » Needs review
StatusFileSize
new2.95 KB

Have done more modifications in the paragraph , adding descriptions regarding dependency injection and events and removing the spaces at end-of-line. I hope these changes are valid ones

Thanks!
~Chirag

xjm’s picture

Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: -Triaged for D8 major current state

Thanks for starting on this @chishah92 (and thanks @jhodgdon for reporting the issue).

@alexpott,@webchick, @catch, @effulgentsia, @Cottser, and I discussed this and agreed this could just be considered a normal priority docs bug. The information it is giving is not technically wrong, just... incomplete. (There are definitely other major documentation bugs in core, but this is not one I think.)

From @chishah92's starting patch, it seems to me that a lot of this information is ending up duplicating existing information in the codebase and on the web. The page at https://api.drupal.org/api/drupal is a thorough list of topics, thanks to work by @jhodgdon and others during Drupal 8's development. So, rather than writing up another overview of the APIs, I think it would instead be better to remove the stuff about "hooks and functions" and refer people directly to the extending topic (see https://www.drupal.org/node/1354#link for how). Then, we can update the link to the comprehensive overview on api.d.o as @jhodgdon suggests, and that should provide them with enough information on how to start.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Status: Needs work » Needs review
Issue tags: +Bug Smash Initiative
StatusFileSize
new1.59 KB

The README.txt was updated in #3192842: Make our README more welcoming by converting it into an "entrypoint" into the Drupal ecosystem and the text here is now in USAGE.txt.

#13. Removed the hooks and functions section and added a link to the extending page, in the same format used in this file. That is, it doesn't use an @link.

Not testing the patch because it is comments.

quietone’s picture

Version: 8.9.x-dev » 9.3.x-dev
quietone’s picture

Title: Top-level README.txt -- API section talks only about hooks and functions » core/USAGE.TXT -- API section talks only about hooks and functions

And I forgot to update the title.

quietone’s picture

Assigned: chishah92 » Unassigned

Unassigning because it has been 5 years.

dww’s picture

Status: Needs review » Reviewed & tested by the community
  1. Confirmed that https://api.drupal.org/api/drupal/core%21core.api.php/group/extending is a working link that is the landing page for the 'Extending Drupal' topic. That seems much better than trying to duplicate any/all of that in this .txt file.
  2. Since the test bot didn't try to run it, confirmed that #21 applies cleanly to the 9.3.x branch (as of commit 8fd69fcce) and 9.2.x (commit 7c4ed97), although not to 8.9.x (doesn't matter, that's security only at this point).
  3. #21 is small and clean, removes more lines than it adds, but what it adds is much more useful that what it removes. ;)

Therefore, RTBC!

Thanks,
-Derek

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I agree that linking to the API is much more useful here.

What's missing is the bit about

The
flexible hook architecture means that you should never need to directly modify
the files that come with Drupal core to achieve the functionality you want;
instead, functionality modifications take the form of modules.

I do think that somewhere we need to keep something that says don't hack core. Maybe we can add this to the "Overview of extensions and alteration methods for Drupal." section of core.api.php which is how the content that's linked to is generated.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new1.79 KB

This patch restores the important bit about not hacking core. It does not restore the part and hook and functions because I think this is a high level introductory document. Anyone needing to write code will start reading elsewhere for details of the API.

No interdiff because this is so small.

dww’s picture

I know we're restoring the existing text, so maybe this should just go in as-is. But with the shortened version, it repeats "functionality" a lot. How about this?

Drupal contains an extensive API that allows you to add to and modify the
functionality of your site. This means that you should never need to directly
modify the files that come with Drupal core to achieve the behavior you
want; instead, modifications take the form of modules.
quietone’s picture

StatusFileSize
new1.77 KB

@dww, thanks. I think your version is better. I've updated the patch (no interdiff due to size) and started the tests.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks! #26 is fixed. No further concerns with #29. Back to RTBC! 🎉

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed c304842b8e to 9.4.x and 93f0416955 to 9.3.x. Thanks!

  • alexpott committed c304842 on 9.4.x
    Issue #2707163 by quietone, chishah92, jhodgdon, AndrewHD, xjm, dww,...

  • alexpott committed 93f0416 on 9.3.x
    Issue #2707163 by quietone, chishah92, jhodgdon, AndrewHD, xjm, dww,...

Status: Fixed » Closed (fixed)

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