wieni / wmsingles Goto Github PK
View Code? Open in Web Editor NEWSingles are node types used for one-off pages that have unique content requirements
License: MIT License
Singles are node types used for one-off pages that have unique content requirements
License: MIT License
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;
}
main
Create derivative menu items under the existing menu item, containing all single node types with their entity operations.
Quicker navigation.
phpstan.neon
config file referencing the wmcodestyle
rule files (example)phpstan analyse
to the coding-standards
composer scriptautoload-dev
entry to ensure autoloading during analysiswieni/wmcodestyle
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();
}
can I join?
In 40e70a7 a dependency to wieni/wmcontroller sneaked in ๐
It's safe to just swap to core's ControllerBase
instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.