The block title is not showing up. The block configure has a block title set and the view has a title as well but none are showing up on the live site. The block content (a part from the title) is showing up.

Comments

drupal10’s picture

More info on this after more troubleshooting...the block title does not show up with the "grid" style selected in the view. It does show up when the style is unformatted or html list.

nicholas.alipaz’s picture

For me, it doesn't show on exposed filter blocks from views, if I set the site to disable the core block system. When I reenable the core block system it works fine.

nicholas.alipaz’s picture

Looks like for me, changing line 361-365 (plugins/context_reaction_block.inc) from:

      // Only query for custom block title if block core compatibility is enabled.
      if (!variable_get('context_reaction_block_disable_core', FALSE)) {
        global $user, $theme_key;
        $block->title = db_result(db_query("SELECT title FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block->module, $block->delta, $theme_key));
      }

to:

      // Query for block title.
      global $user, $theme_key;
      $block->title = db_result(db_query("SELECT title FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block->module, $block->delta, $theme_key));

Fixed my issue. I am not sure why we would only allow using title if core block system is enabled. drupal10 please let us know if you had the same issue, or if my issue is different. I can open a new thread if so.

tuwebo’s picture

Same issue,
If I go to admin/build/context/settings and disable "Core block system", the block title disappear but the block "body" shows up normaly.

If I have "Core block system" enabled, then, the title shows up and the body too.

marcoBauli’s picture

Status: Active » Needs review

#3 solution works. If is there any collateral in doing so please point it out. Thx

hefox’s picture

Status: Needs review » Active

Needs review implies a patch; there is no patch.

nicholas.alipaz’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.11 KB

Here is a patch against 6.x-3.x branch. Exact same code that has already been tested by marcoBauli and on 7 enterprise level sites with the company I work at.

If you feel it needs more testing then just change the status and let us know. Best!

hefox’s picture

Status: Reviewed & tested by the community » Needs work

For those not using core blocks for anything, this is going to cause a flood of extra queries for a not-overridden-title (and may effect sites that had changed title, then decided not to use core blocks).

so need
1) upgrade path
2) way to disable it for those that don't actually want/need that query.

nicholas.alipaz’s picture

Status: Needs work » Needs review
StatusFileSize
new2.42 KB

Here is a version that adds a new setting for this under the settings page. It should allow for sites not enabling this setting to continue operating properly.

hefox’s picture

Status: Needs review » Needs work

Thanks, some nitpicking:

+++ b/plugins/context_reaction_block.inc
@@ -196,6 +197,14 @@ class context_reaction_block extends context_reaction {
+      '#default_value' => variable_get('context_reaction_block_disable_block_titles', 1),

TRUE is standard for default value of boolean settings (and what others are using)

+++ b/plugins/context_reaction_block.inc
@@ -357,8 +366,8 @@ class context_reaction_block extends context_reaction {
+      if (variable_get('context_reaction_block_disable_block_titles', 1) === 0) {

!variable_get is easier to read

TRUE

Should this be checking both variables? Haven't tested patch, but looks like one setting is based on the other due to that ctools stuff.

nicholas.alipaz’s picture

This should do it then.

Best!

nicholas.alipaz’s picture

Status: Needs work » Needs review
StatusFileSize
new2.6 KB

Actually, just thought of another issue with backwards compatibility. This should fix that too.

nicholas.alipaz’s picture

@hefox, anymore comments on the patch I wrote in #12? I think it is pretty good and I just deployed to 3 sites here.

hefox’s picture

It looks good to me, but haven't applied/tested it.

basvredeling’s picture

I quickly tested it, and it seems to work ok. But I think the description 'If checked then Context will not use the block title settings that are configured in core.' could be much clearer. It should state what it DOES use and what the result will be. Something like: "If checked the block will show it's default title, instead of the title set in the core block configuration."

And I'm thinking the setting should be context specific. The thing is that disabling the block system globally is something completely different than disabling title overrides globally. The first serves to replace one system with another, the second serves to disable one system (but not replace it by another, ie: you can't override the title of a block using context_ui).

paulocs’s picture

Issue summary: View changes

I tried to reproduce with the last dev versiof of context 7.x and I could not reproduce it.
I will close the issue as context 6.x is no longer supported.

paulocs’s picture

Status: Needs review » Fixed
paulocs’s picture

Status: Fixed » Closed (fixed)