Hi All,

Please see 2 attached screenshots.

okay.png shows that there is a +Account roll over linking to other Profile2 pages. okay.png is using the regular Rubik 7.x-4.x-dev (2011-Nov-03).

I made a subtheme that is currently just loading a .css file to overwrite some Rubik styling. Here is my subtheme .info file.

name = Rubik Custom
base theme = rubik
description = Rubik theme with some customization
core = 7.x
version = "7.x-1.0"
engine = phptemplate

stylesheets[all][] = css/styles.css

Here is my stylesheet right now...

p {
	color:#333;
}

When using my custom Rubik subtheme I see what is in the attached error.png. No +Account. =/

Thanks for reading,
-Tim

Comments

overtune’s picture

I'm having the same problem... Is there any solution for this?

Thanks in advance.

zzolo’s picture

Title: Profile 2 secondary tabs don't appear on user profile page when using a Rubik Subtheme. » Why does Rubik not render secondary tasks for subthemes?
Category: bug » support

This is actually true of all secondary tabs when using a sub theme. This is actually caused from a very specific piece of code:

  // Process local tasks. Only do this processing if the current theme is
  // indeed Rubik. Subthemes must reimplement this call.
  global $theme;
  if ($theme === 'rubik') {
    _rubik_local_tasks($vars);
  }

Why is this?

Anonymous’s picture

You need to reimplement the function in your custom template of your subtheme.

/**
 * Preprocessor for theme('page').
 */
function YOURTHEMENAME_preprocess_page(&$vars) {
  // Process local tasks. Only do this processing if the current theme is
  // indeed Rubik. Subthemes must reimplement this call.
  global $theme;
  if ($theme === 'YOURTHEMENAME') {
    _rubik_local_tasks($vars);
  }
}
adammalone’s picture

This needs to be implemented within rubik to check if the active theme uses rubik as base:

  global $theme_info;
  if (array_key_exists('rubik', $theme_info->base_themes)) {
    _rubik_local_tasks($vars);
  }
adammalone’s picture

Title: Why does Rubik not render secondary tasks for subthemes? » Execute _rubik_local_tasks in subthemes - patch attached
Category: support » feature
Status: Active » Needs review
StatusFileSize
new509 bytes

patch attached

star-szr’s picture

Patch looks good, tested and working.

Edit: spoke too soon, seeing errors:

Notice: Undefined property: stdClass::$base_themes in rubik_preprocess_page() (line 129 of …/rubik/template.php).
Warning: array_key_exists() expects parameter 2 to be array, null given in rubik_preprocess_page() (line 129 of …/rubik/template.php).

Looks like in my subtheme $theme_info actually contains 'base_theme' which is a string, not an array called 'base_themes'.

I just have base theme = rubik in my .info.

adammalone’s picture

StatusFileSize
new80.09 KB

Which version of rubik are you using?

Can you do a dpm of $theme_info just after the global is called on line 128 of template.php?

The dpm I get reveals both an array called base_themes ($theme_info->base_themes['rubik']) as well as $theme_info->base_theme

Suppose someone makes a rubik subtheme and someone makes a subtheme of that. $theme_info->base_theme only shows the parent, whereas the array of base themes shows all parents right back to the very base theme which is the safest way of including rubik should the theme created be a subtheme of a subtheme of rubik.

For the record I'm using Rubik 7.x-4.0-beta8

star-szr’s picture

I did a quick dpm() yesterday and couldn't see a $base_themes array in $theme_info - both in 4.0-beta8 and 4.x-dev.

I'm not sure why we need the if ($theme === 'rubik') {} and why this got punted to subthemes. Maybe this fixed a bug at some point, but I did a git blame and it looks like the code around this hasn't changed at all since the D7 port. Could have been a workaround for a core bug that has since been fixed, who knows.

adammalone’s picture

StatusFileSize
new639 bytes

Seems like a case of me not seeing the wood for the trees... I guess I didn't think of just removing the if ($theme === 'rubik') {} check!

Here's a rerolled patch for rubik which doesn't have that check. Since the rubik template.php will only be in effect for rubik and its subthemes I can't envisage an immediate issue.

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

I think unless we can get an explanation for why the condition needs to be there it can be safely removed.

I tested with both rubik and my rubik subtheme on the manage display and theme settings pages. Everything works as expected, so RTBC from me. If someone else can test the patch and report their results that would be great.

coffeymachine’s picture

Status: Reviewed & tested by the community » Fixed

This is something that is still around from the old 6.x version from Development Seed. I don't see any reason why that check needs to be there either.

Committed to the 7.x-4.x branch.
Thanks!

Status: Fixed » Closed (fixed)

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