Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently working on themes is not perfect. The theme information is cached so hard, that you cannot just add a new library.
Proposed resolution
Ensure that not only the theme registry but also the information coming from .info.yml is rebuild
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#1 | theme_rebuild-2330743-1.patch | 4.41 KB | dawehner |
Comments
Comment #1
dawehnerHere is a version which works, but has a workaround for a core bug.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedLooks fine. Does Drush need changes to `drush cc theme-registry`?
Has there been discussion of Drupal implementing type hinting as per http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata?
Comment #3
dawehner@moshe weitzman
In case you consider the information in the .info.yml file as important as well, yes.
No idea regarding your question.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedSave the code below to /.phpstorm.meta.php and then you autocomplete for the theme_handler service *everywhere*. No more type hinting each call. Here are the PHPstorm docs for this. I'm using PHPStorm7.
I really think Drupal or Drush should have a script for generating this file for all services and other factory stuff.
Comment #5
dawehnerThe actual reason is not just typehinting in the idea. It is about actually making the source code easier to read, as you don't have
to figure out what kind of class this is, especially helpful in NON-IDE environments.
Comment #6
Hydra CreditAttribution: Hydra commentedWorking for me, +1 for RTBC, this is really annoying while theme development...
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedFixed thx.
Created https://github.com/drush-ops/drush/issues/805 to handle `drush cc theme`