The block cart section does not show the cart icon and the arrow that allows the block to be expande when change the title of the block

Comments

tr’s picture

Status: Needs review » Active

If you want to change the name of the cart block you should change the "Cart name" on the block configuration page, not the "Block title". If you change "Block title" then Drupal is in control of what gets displayed there - not Ubercart - and Drupal doesn't know anything about the cart icon and the arrow to expand the block.

Changing this to a feature request - perhaps we can alter the configuration form so the "Block title" field which is automatically generated by Drupal doesn't show for the cart block.

tr’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new1.33 KB

And here's a patch that implements what I suggested in #1 ...

longwave’s picture

Status: Active » Needs review

Setting $block['title'] = FALSE when returning from uc_cart_block() op 'view' will override the default block title formatting, look at the latter half of the code in block_list() in block.module.

Perhaps the separate "cart name" field and variable should be dropped, leaving the default Drupal block title field, which we can then read from the database in uc_cart_block() and theme into $block['subject'], using $block['title'] = FALSE to force Drupal to always use our custom HTML for the title instead?

longwave’s picture

StatusFileSize
new4.23 KB

Attached patch does what I describe in #3, and includes an update function to move existing custom block titles into the standard block title field. Seems to make more sense to do things this way, than replace a perfectly good field with a custom one that in the end does the same thing, and saves one row in the variables table!

longwave’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed #3. Needs porting to 7.x.

longwave’s picture

StatusFileSize
new3.97 KB

Committed the attached followup to 6.x which moves the block title re-theming to hook_preprocess_block() which seems a bit cleaner.

longwave’s picture

Status: Patch (to be ported) » Fixed
StatusFileSize
new5.57 KB

Committed the attached patch to 7.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

whatsanike’s picture

I have the problem described because I changed the title. Only what I don't know is how to implement the patch. I have drupal 7.0. I can edit the file in question through the cPanel file manager, but I don't know where to put the code or which code to delete! Could someone just clue me in on where to paste the code, or if there is a way to compile the patch into the file?