Giter VIP home page Giter VIP logo

wmsingles's People

Contributors

akasake avatar dieterholvoet avatar hans-langouche avatar hnln avatar robinhoutevelts avatar spoit avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

drupallabs

wmsingles's Issues

Warning generated in overview controller

The $list is not initialized to array. So if there are no singles to get then a warning is popped.

-- Added $list = [];

    /**
     * Get all single content types.
     * @return array|mixed
     */
    public function getAllSingles()
    {
        $list = &drupal_static(__FUNCTION__);
        if (!isset($list)) {
            $list = [];
            /** @var NodeTypeInterface $type */
            foreach (NodeType::loadMultiple() as $type) {
                if ($this->isSingle($type)) {
                    $list[$type->get('type')] = $type;
                }
            }
        }
        return $list;
    }

Clean up branches

Description

  • Clean up unused branches (check Sourcegraph to make sure the branch is not directly required in a composer.json file)
  • Switch default branch to main

Update wmcodestyle

  • Add phpstan.neon config file referencing the wmcodestyle rule files (example)
  • Add phpstan analyse to the coding-standards composer script
  • Add autoload-dev entry to ensure autoloading during analysis

Clean up module

  • Cleanup code using wieni/wmcodestyle
  • Normalise composer.json
  • Add LICENSE in case it's missing. Also add the license to composer.json.
  • Add CHANGELOG.md (and UPGRADING.md, if applicable)
  • Add issue & pull request templates
  • Update repo description & tags
  • Update README
  • Update .gitignore
  • Check dependencies: ensure composer.json has a php & drupal/core version requirements and add missing requirements to the .info file

Check $type for null

Currently $type is not in the IF.

Sometimes it is null not sure why but when the module : drupal/admin_links_access_filter is on.

    /**
     * @param NodeInterface $node
     * @return \Drupal\Core\Access\AccessResultForbidden|\Drupal\Core\Access\AccessResultNeutral
     */
    public function access()
    {
        /** @var NodeTypeInterface $type */
        $type = $this->currentRoute->getParameter('node_type');

        if ($type && $this->wmSingles->isSingle($type)) {
            return AccessResult::forbidden();
        }

        return AccessResult::allowed();
    }

Add module to Drupal.org

  • Create the Drupal project (example)
  • Change the license to GPLv2 to comply with Drupal.org requirements (example)
  • Update the composer install command in the README
  • Add contributing section to the README (example)
  • Archive this repository, make it point to the new one
  • Abandon the package on Packagist and put drupal/node_singles as replacement (example)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.