Chapabu
  • Member for 10 years, 2 months
  • Last seen more than 2 years ago
2 answers
4 votes
523 views
Do I have to activate a parent theme when I activate its sub theme?
Accepted answer
6 votes

No it doesn't. As long as the base theme is present, that's OK. As an example, if you test the Sky theme on Simplytest.me and go to the admin/appearance page, you'll see that Sky is enabled, but the ...

View answer
4 answers
20 votes
26k views
How do I turn off account creation?
Accepted answer
37 votes

The answer given on How do I remove the user registration/login form? is relevant for this question too. While it's technically possible to remove the login functionality, you shouldn't, because then ...

View answer
2 answers
2 votes
1k views
Résumé upload functionality in Drupal 7
Accepted answer
2 votes

Add a Résumé content type. Add your text fields and a file field to this content type. Set your permissions accordingly, allowing whichever user roles you want (or anonymous) to create this content. ...

View answer
2 answers
-2 votes
2k views
Error when using the Domain Access module
4 votes

You can access the readme file here. There is also a quickstart version here. The main bit you will need is the following (taken from the quickstart version - line 24): Add the following four ...

View answer
2 answers
3 votes
5k views
"PHP Notice: Constant DATE_RFC7231 already defined in /ext/vhosts/public/includes/bootstrap.inc on line 258"
Accepted answer
2 votes

Are you certain you're running PHP 5 and not a version of PHP 7? I've only ever seen that error when running PHP 7, and it was due to DATE_RFC7231 already defined in PHP 7.0.19 and 7.1.5. Either way, ...

View answer
2 answers
3 votes
851 views
Drupal 8 and jQuery 3 support
1 votes

As Clive said, you can add whatever version of jQuery you want to a page. However, there's an issue here worth following Update jQuery to version 3 Now that jQuery 3.0 has been released jQuery 2.x ...

View answer
6 answers
36 votes
13k views
How do I avoid checking for updates for a specific module?
Accepted answer
33 votes

You need to implement hook_update_projects_alter(). Alter the list of projects before fetching data and comparing versions. Most modules will never need to implement this hook. It is for ...

View answer
3 answers
0 votes
1k views
How to use Drupal Code Sniffer in windows?
2 votes

On the project page there are instructions for each IDE. The one you're after (Eclipse) is here. In case anyone uses something else, the other instructions are as follows: Vim, Sublime Text, and ...

View answer
2 answers
3 votes
5k views
Display user's name instead of username
Accepted answer
4 votes

I'd add a new field called Display Name (or similar), then then use hook__user_format_name_alter() to load in that field, and change the display name to use the field value instead of the user name. ...

View answer
4 answers
1 votes
2k views
How do I force nodes to have revisions by default when using REST?
2 votes

You should be able to set this option to be checked by default. If you go to the edit page for your content bundle (i.e. admin/structure/types/manage/article), under Publishing options, you can ...

View answer
1 answers
0 votes
530 views
Create an SVG using data from Views
0 votes

Without knowing your exact use case (I'm assuming you want to just use Views to use the results to build an SVG); it sounds like building a custom Views display style plugin might be in order. There'...

View answer
1 answers
1 votes
1k views
Am I able to use dynamic parameters in libraries configuration files?
3 votes

You should be able to use hook_library_info_build(). It's a new (to D8) hook that allows you to define libraries at runtime. Here's the change record that talks about it's introduction. It's unlikely ...

View answer
1 answers
0 votes
181 views
How do I disable update checks for locked projects?
Accepted answer
1 votes

drush cron will trigger the default update manager search, whereas locked project are only locked during drush pm-updatestatus. If you want to prevent Update Manager from checking for particular ...

View answer
3 answers
10 votes
905 views
How to fix "Hook implementations should not duplicate @param documentation."?
2 votes

Adding an answer for posterity; as per Clive's comment: You need to turn off the built in PHPStorm inspection that checks for "Missing PHPDoc Comments", then you can safely delete your @param blocks....

View answer
3 answers
4 votes
5k views
Configuration Manager or hook_update() to enable modules
0 votes

I've yet to run into any issues just using configuration management, so I'd just stick with that for now. The only thing that could be considered an issue is environment specific modules (i.e. Devel) ...

View answer
5 answers
14 votes
17k views
How can I get the page title?
Accepted answer
24 votes

If you check the change records you should find the following: drupal_set_title() and drupal_get_title() were removed. You'll have to read the change notice for all of the info, but here is a ...

View answer
1 answers
1 votes
29 views
Utilizing private methods/vars inside module
2 votes

Yes - it's that simple. Remember; Drupal is only PHP. Although your class should be called MyClass.php rather than MyClass.class.php to adhere to the Drupal Coding Standards for OO code (note - this ...

View answer
1 answers
1 votes
131 views
Why is it considered improper to directly add an `onclick` attribute to an HTML element?
4 votes

There's a good answer in the JavaScript subreddit on reddit here. To summarise, here are the reasons provided: tight coupling between presentation and behavior code runs in the global scope ...

View answer
2 answers
0 votes
433 views
Override entire user login / register page
Accepted answer
0 votes

You should copy your theme's page.tpl.php to page--user.tpl.php as you already have to create the template that will be used for the page. Following that, in your template.php create implement ...

View answer
1 answers
0 votes
3k views
Bootstrap sub-theme override CSS
0 votes

I'd wager that the stylesheet has not been added to the page. The documentation is pretty solid on this: Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 theme. This page isn't likely to go ...

View answer
2 answers
1 votes
48 views
How to make my new administration page use my administration theme?
Accepted answer
4 votes

There's a permission named View the administration theme. This should be given to the accountant role to allow users with that role to view the admin theme instead of the site theme. If that ...

View answer
1 answers
0 votes
1k views
Drupal 7 Is the a way to programmatically know the Fields in a Content Type?
Accepted answer
5 votes

field_info_instances(); will get you a list of all field types on a specific entity/bundle. For example: $fields = field_info_instances('node', 'movie'); print_r($fields); Will give you a list of ...

View answer
4 answers
2 votes
195 views
install modules with custom module
2 votes

If you define the modules in the subdirectory as dependencies of your main module, then they'll be enabled once your "controller" module is. i.e. name = Really Neat Widget description = Provides a ...

View answer
1 answers
1 votes
38 views
How to migrate Drupal Commerce configuration between environments
Accepted answer
2 votes

Commerce Features has helped me in the past. Apart from that, you're looking at update hooks (or possibly the Configuration Management module).

View answer
3 answers
1 votes
158 views
Action on module enable?
0 votes

hook_module_enable() should do the job unless I'm missing something from your question. Perform necessary actions after module is enabled. The hook is called every time the module is enabled. ...

View answer
2 answers
0 votes
52 views
Is there an efficient easy way to test Drupal code while developing it?
1 votes

As you're comfortable with Grunt, I've got a Gruntfile that I wrote that I use as a stub for most projects. You can find it here github.com/Chapabu/grunt-drupal-standards/. Just clone it to your ...

View answer
14 answers
15 votes
20k views
Can I delete nodes of a given content type with Drush?
Accepted answer
5 votes

You could create a function like follows: function MYMODULE_delete_all_the_things() { $query = new EntityFieldQuery; $result = $query->entityCondition('entity_type', 'node') ->...

View answer
3 answers
1 votes
7k views
I need a way to automatically make Panel layouts responsive
Accepted answer
3 votes

I think the closest you're going to get to out of the box is Panels Extra layouts, which ships with a bunch of adaptive layouts. Other than that, your best bet is just to create a bunch of custom ...

View answer
2 answers
1 votes
1k views
How to query the Database logs and create summary reports and/or charts of them?
Accepted answer
4 votes

The Views Watchdog module might be useful. The Views Watchdog module extends the Views module and allows to create customized lists (pages, blocks, feeds) of watchdog entries. Combine it with ...

View answer
1 answers
1 votes
194 views
Can hook_field_extra_fields be used with field collections?
3 votes

The entity name for a Field Collection is actually field_collection_item and not field_collection (if you run var_dump(entity_get_info()) you'll see this). This means your implementation should ...

View answer
1
2 3 4 5
13