Provide documentation for 4.x branch

Created on 8 July 2020, over 4 years ago
Updated 17 February 2023, about 2 years ago

Now that a beta release is out, it would be great to update the documentation and provide some code examples for 4.x as was done for 3.x .

A good start would be copying the structure of the linked page but updating the code examples for 4.x (since the code is completely different in D8).

🐛 Bug report
Status

Active

Version

4.0

Component

Documentation

Created by

🇯🇵Japan ptmkenny

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom problue solutions Northern Ireland

    Discovering whether a piece of content is flagged

    Use the isFlagged() method to find out if an item is flagged.

    Example:

    $flag_id = 'bookmark';

    $flag_service = \Drupal::service('flag');
    $flag = $flag_service->getFlagById($flag_id);

    if ($flag && $flag->isFlagged($entity) {
    print "This entity has been bookmarked!";
    }

    Is this supposed to return true if the flag id is flagged by any user for the given entity?

    Im trying this code and it isnt returning true for a flag id that i know for sure is flagged by at least one user for the given entity.

  • Assigned to ressa
  • 🇩🇰Denmark ressa Copenhagen

    Thanks @ptmkenny, let's get this moving. I have updated the Issue Summary, and added a few extra tasks.

  • 🇩🇰Denmark ressa Copenhagen
  • 🇩🇰Denmark ressa Copenhagen
  • 🇩🇰Denmark ressa Copenhagen

    I got an MR ready, so changing status.

  • Pipeline finished with Success
    17 days ago
    Total: 210s
    #429630
  • 🇯🇵Japan ptmkenny

    @ressa How can this be "Needs review" when you turned it into a meta issue? If an issue has multiple tasks, it can't be "needs review" until all the tasks are completed. Further, your MR ignores all the comments that have already been written. It seems like you should've opened a separate issue instead of adding to this one.

  • 🇯🇵Japan ptmkenny

    ptmkenny changed the visibility of the branch 3157623-provide-documentation-for to hidden.

  • 🇯🇵Japan ptmkenny

    @ressa I've reverted your changes to the IS. If you want to create a meta issue, please create a new issue and link to this one.

  • 🇩🇰Denmark ressa Copenhagen

    I am sorry, I assumed it was all right, since this issue had been stale since 2020 ...
    But I guess I just need to re-do everything in a new issue.

  • 🇯🇵Japan ptmkenny

    As far as I know, the code in #2 is ready to go, but there's a bigger question that needs to be answered, which is "Is flag going to provide code examples for 4.x like it did for previous versions?" or will people be referred to the API docs instead.

    This is something for the maintainer to decide.

    Also, while the examples in #2 are ready to go, it doesn't cover the same scope as the docs for 3.x.

Production build 0.71.5 2024