When using the block that comes packaged with this module, I cannot change the block title. The title "Facebook Stream" does not change when I change the title in the block configuration.

If anyone has a solution please let me know, for now I will look into it.

Comments

rickyd1’s picture

Okay I have a fix to this issue:

I am not sure how to create patches as I am green to module development. However, I looked at the API and a tutorial on creating module and found a fix to this.

On line 88 of facebook_pull.module the block is declared with this code

function facebook_pull_block_view($delta = '') {
  $block = array();
  
  switch ($delta) {
    case 'facebook_pull_default':
      $block = array(
        'title' => t('Facebook stream'),
        'content' => _facebook_pull_render_block(),
      );
      break;
  }
  
  return $block;
}

The line that sets the title is:

'title' => t('Facebook stream'),

When it is set, we will not be able to change the title in the configuration screen. However, if we change 'title' to 'subject' , we will be able to change the title. The block will use the subject as the title if we do not set a title in the configuration screen.

Here is the change:

'subject' => t('Facebook stream'),

After making this change, my new code looks like this:

function facebook_pull_block_view($delta = '') {
  $block = array();
  
  switch ($delta) {
    case 'facebook_pull_default':
      $block = array(
        'subject' => t('Facebook stream'),
        'content' => _facebook_pull_render_block(),
      );
      break;
  }
  
  return $block;
}

It seems to be working fine. Does anyone see any issues with this change that will effect the module?

aidanlis’s picture

Looks like you are right, I will update the module when I get some spare time.

creact’s picture

I am having the same issue. Will there be a fix soon?

zr2d2’s picture

Status: Needs review » Active
StatusFileSize
new450 bytes

per [#2], I found this change on the 6.x branch, but not the 7.x branch. here is a patch of #1 for the 7.x branch, which may fix @creact's problem

zr2d2’s picture

Status: Active » Needs review

updating status, per #3

Status: Active » Needs review
froboy’s picture

Tested and works but still needs to be committed. Any possibility of getting this in?

kyuubi’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
zrowe007’s picture

What is the process for committing this?

smurfxx’s picture

@zrowe007 in this case you have to change only one row, open the file facebook_pull.module that it's in sites/all/modules/facebook_pull
Search for the row that contains "'title' => t('Facebook stream')," delete it and write this row:

" 'subject' => t('Facebook stream'), "

If in the future you will find bigger patches that this, so I suggest you to inform here

Anyway, this patch works!

zrowe007’s picture

@smurfxx yes, I am the author of #4 (I had to create a new account), I was wondering if I needed to do anything else to submit this for inclusion (perhaps a git commit).

daveferrara1’s picture

Status: Reviewed & tested by the community » Fixed

Patch Applied.

  • daveferrara1 committed 13c2d6b on 7.x-1.x authored by zrowe007
    Fixed Block Title so it can be changed thanks to zrowe007 issue #1436346
    
daveferrara1’s picture

Status: Fixed » Closed (fixed)