I'am working on porting the twig-for-drupal template engine from 6 to 7 and i used the drupal_get_path function to nicely ask the system where the user placed the twig.engine file.

However, drupal_get_path does dirname(drupal_get_filename.. call, and this function returns false for an external theme_engine. Which could make some sense since theme_engine's aren't registered in the system table. But the query on line 680 in bootstrap.inc returns a "" and this result is tested with a file_exists function on DRUPAL_ROOT. The result is stored in the static $files array. So the array actually has the value set, which prevents the entire fallback starting on line 695 to be passed.

The fix is easy, just add an extra AND clause to the if on 683.

See attached netbeans generated patch file.

Comments

Status: Needs review » Needs work

The last submitted patch, bootstrap.patch, failed testing.

rene bakx’s picture

StatusFileSize
new1.09 KB

new patch file, previous patch seems corrupted?

rene bakx’s picture

StatusFileSize
new1.09 KB

noobish me forgot, .diff should be .patch :(

rene bakx’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, bootstrap.patch, failed testing.

rene bakx’s picture

Status: Needs work » Needs review

Can somebody please explain why the patch fails, yet is done like the procedure explains?

tstoeckler’s picture

--- ./d7/includes/bootstrap.inc	2010-11-04 20:01:46.000000000 +0100
+++ ./d7-dev/drupal/includes/bootstrap.inc	2010-11-04 19:48:44.000000000 +0100

The paths are corrupted. This should read:

--- includes/bootstrap.inc ...
+++ includes/bootstrap.inc ...

Powered by Dreditor.

Edit: added code tag.
Edit2: Fixed typo.

rene bakx’s picture

Ah thank you :) So the patch needs to reference itself! Super!.. Then I will make a new patch on D7-B3 later this weekend.

rene bakx’s picture

Status: Needs review » Closed (won't fix)

closing up ancients...