Moodle

Some blocks' styles.php not being included.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Blocks, Themes
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Some blocks' styles.php files are not being included by themes/styles.php.
Specifically, I've been able to produce this bug with the Accessibility block, while other blocks on the page are having their styles.php included.
From what I can tell from the debugging I've done, the stylesheet isn't added to the $files array after the calls to get_sheets_for_plugin_type on line 119.

Activity

Hide
Tim Hunt added a comment -

Ah, here is a guess. Is your block called 'Accessibility' or 'accessibility'? (That is the name of the folder.) It must be all lower-case.

Show
Tim Hunt added a comment - Ah, here is a guess. Is your block called 'Accessibility' or 'accessibility'? (That is the name of the folder.) It must be all lower-case.
Hide
Mark Johnson added a comment -

It's all lowercase, as is the name of the class. The only place it appears with a capital A is in the lang file. Would it help if I attached the updated block? (the version in the M&P database is for 1.9)

Show
Mark Johnson added a comment - It's all lowercase, as is the name of the class. The only place it appears with a capital A is in the lang file. Would it help if I attached the updated block? (the version in the M&P database is for 1.9)
Hide
Tim Hunt added a comment -

Yes. Please attache the block.

Of course, get_sheets_for_plugin_type is just at the end of themes/styles.php, so if you are able to debug this further yourself, that would be greatly appreciated. Otherwise, please attach the block, and I will take a look when I can. (I am kind-of on holiday at the moment )

Show
Tim Hunt added a comment - Yes. Please attache the block. Of course, get_sheets_for_plugin_type is just at the end of themes/styles.php, so if you are able to debug this further yourself, that would be greatly appreciated. Otherwise, please attach the block, and I will take a look when I can. (I am kind-of on holiday at the moment )
Hide
Mark Johnson added a comment -

I did have a poke around in the function, but I couldn't get any meaningful debugging with what I was trying. I'll have another go before posting the block up and let you know if/what I find.

Show
Mark Johnson added a comment - I did have a poke around in the function, but I couldn't get any meaningful debugging with what I was trying. I'll have another go before posting the block up and let you know if/what I find.
Hide
Mark Johnson added a comment -

Found it. It seemed that while the function was returning the correct files, the += operator wasn't joining it to the $files array correctly. The attached patch changes it to use array_merge(), which seems to work as expected.

Show
Mark Johnson added a comment - Found it. It seemed that while the function was returning the correct files, the += operator wasn't joining it to the $files array correctly. The attached patch changes it to use array_merge(), which seems to work as expected.
Hide
Tim Hunt added a comment -

Ah nice one. I always get + and array_merge confused. Thanks for catching it. Fix now in CVS.

Show
Tim Hunt added a comment - Ah nice one. I always get + and array_merge confused. Thanks for catching it. Fix now in CVS.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: