Chapabu
  • Member for 10 years, 2 months
  • Last seen more than 2 years ago
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
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
904 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
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
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
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
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
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
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
3 answers
5 votes
2k views
Is it possible to do a drush sql-sync of only certain tables?
2 votes

If you check out the Drush Commands page for sql-sync (or drush sql-sync --help) then you'll notice there is a parameter called --skip-tables-list. --skip-tables-list : A comma-separated list of ...

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
32 views
Follow up Drupal path to PHP function
Accepted answer
1 votes

You can find out from the implementing module's implementation of hook_menu. In your case, look for where Flag implements hook_menu (in the case of Flag 7.x-3.x you're looking at flag.module at ...

View answer
1 answers
1 votes
62 views
Is it possible to use Views for listing data created in a custom module?
Accepted answer
2 votes

I know link-only answers are generally frowned upon, but this series of blog posts are unlikely to ever go anywhere and are WELL worth a read: Building Views Query Plugins: Part 1 - Mapping web ...

View answer
2 answers
2 votes
8k views
Drush Enable a module and all its submodules
Accepted answer
4 votes

There's nothing out of the box, however you can just list the three modules and then coder will also be enabled as it's a dependency. E.g. drush en coder_review coder_sniffer coder_upgrade -y If there ...

View answer
3 answers
0 votes
98 views
Access custom user field from a different account
Accepted answer
1 votes

This seems a bit dirty, but using your exact code as a base, something like the following may work: $uids = array( // Here is the list of user ID's that you know. ); $full_names = array(); ...

View answer
5 answers
6 votes
6k views
Assign a role upon registration
2 votes

Another option is the Auto Assign Role module: The Auto Assign Role serves three primary purposes. The first is to provide an automatic assignment of roles when a new account is created. The ...

View answer
2 answers
0 votes
68 views
Is there any way to change home page on small screen?
0 votes

To actually answer your question (Is there any way to set the front page according to the screen size). No. Especially as you mentioned that you don't want to use JavaScript in a comment to Inizio. ...

View answer
1 answers
1 votes
700 views
What file and directory permissions do I need in my Features directory?
1 votes

This is because Feature is doing something that's a little bit out of the ordinary ;-) This is also one of the reasons I have my filesystem laid out as follows: sites/all/modules/ - custom // ...

View answer
1
2 3 4 5
13