Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 45675

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

1 vote
Accepted

How do I detect whether any contact forms have been created?

You can use the D8 config factory interface to retrieve multiple contact form config keys and their corresponding config entities: $contact_form_keys = \Drupal::configFactory()->listAll('contact.form' …
Shawn Conn's user avatar
  • 26.9k
4 votes
Accepted

How do I use the flood interface?

They are two different parameters that share the same name (and can share the same value by default). Per the docs for FloodInterface: ::register(): int $window: (optional) Number of seconds befor …
Shawn Conn's user avatar
  • 26.9k
4 votes
Accepted

How do you add type-property schemas from Schema.org into 8 sites?

In Drupal 8, the project has deferred to the RDFUI project, to provide the UI component, now that other parts of the module have been ported to core. … The default RDF mappings of Drupal core have been updated to include schema.org in Drupal 8. Also, a lot of the backend code of this module was ported into Drupal 8 core. …
Shawn Conn's user avatar
  • 26.9k
7 votes
Accepted

How can I get the active menu trail for the current page?

MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters() is what you want. To use the example above: $menu_tree = Drupal::menuTree(); $parameters = $menu_tree->getCurrentRouteMenuTreeParameters('ma …
Shawn Conn's user avatar
  • 26.9k
0 votes
Accepted

Including a large amount of raw data with a module

Your intuition is correct; you should break out your large dataset into some include file. I don't believe there's a strict mention of large datasets in the Drupal coding standards, but isolating out …
Shawn Conn's user avatar
  • 26.9k
8 votes
Accepted

How do I use Path Matcher for front page?

Your code is assuming that the request URI for / will retrieve /node on the getAliasByPath() method call. It won't. Setting the Drupal front page isn't the same as setting a path alias in the Path mod …
Shawn Conn's user avatar
  • 26.9k
1 vote

How to Query MySQL Database Module

$connection doesn't exist in the context of hello(). You need to use $this->connection if you're wanting to use the Connection that's built in your object.
Shawn Conn's user avatar
  • 26.9k
1 vote

How to remove undesired local task tabs

Your $access variable is overwritten with the original Node Clone logic that looks at whether the user has the permission. Hence, it will never return an AccessResultForbidden object on the faq conten …
Shawn Conn's user avatar
  • 26.9k
0 votes

How to get route name YAML Block/Form?

Drupal routes aren't display in a UI anywhere, but you can look them up in a database client (e.g. PHPMyAdmin). The route defnitions are stored in the router table. The name, path, & pattern_outline c …
Shawn Conn's user avatar
  • 26.9k
4 votes

Create / Edit node and continue editing on same page after submit

The Save & Edit module is a very basic module. It comprises of 6 total functions, so a port could be done less than a day. Alternatively, if the your requirement is to just save editing progress whi …
Shawn Conn's user avatar
  • 26.9k
1 vote

Reference Live Files with Built-In Server

So drupal server is a Drupal Console wrapper around Symphony's server:start & PHP's built in web server. As you can see in the Symphony (& PHP) docs, you can configure a router script for the server …
Shawn Conn's user avatar
  • 26.9k
0 votes

Access User Data from external script inside a custom module

The code snippet is bootstrapping Drupal by assuming it's in Drupal's root path (i.e. require_once 'autoload.php';) To have it runnable from the module dir, you'll have to alter the relative path to m …
Shawn Conn's user avatar
  • 26.9k
0 votes

Default front page not showing https

Yes. The field prefix is populated by the RequestContext:: getCompleteBaseUrl() method, the underlying property, completeBaseUrl, is assigned from $GLOBALS['base_url'] if it's set. You'll have to te …
Shawn Conn's user avatar
  • 26.9k
0 votes

Can a Drupal Site Administrator view contents of settings.php or some other file in file sys...

For brevity, it helps to think about this question in terms of roles/permissions (since "site admin" is an overloaded term): Does the ____ role have an escalated permission to: Write arbitrary fil …
Shawn Conn's user avatar
  • 26.9k
1 vote
Accepted

How to set time limit only for one php file?

You can find many examples of creating a queue and a queue worker by searching Google for [drupal 8 queue api]. …
Shawn Conn's user avatar
  • 26.9k

1
2 3 4 5
14
15 30 50 per page