I have set smartphone portrait and landscape to use one_col_stack in Desktop-first setting that uses three_col_grail by default. Smartphone landscape works as expected but smartphone portrait uses three_col_grail to my surprise. I tracked this bug to special handling in at_core/inc/forms/at_core.submit.responsive.inc. In smartphone portrait and Desktop-first setting, there's no invocation to one_col_stack and CSS is hardcoded but this CSS is not enough to disable the three columns. When I manually inserted CSS generated by one_col_stack into files/adaptivetheme/MYTHEME_files_884a6dfb/atdrshadrincom.responsive.layout.css for the smartphone portrait case, it succeeded in disabling three columns.

Comments

ogi’s picture

BTW generated smartphone portrait CSS code starts with buggy width property:

@media only screen and (max-width:320px) {
.container {width:}
Jeff Burnz’s picture

Version: 7.x-3.0-rc2 » 7.x-3.x-dev
Assigned: Unassigned » Jeff Burnz

Ouch, good catch, I'm on it!

Jeff Burnz’s picture

OK, so it looks like there is two issues here:

1. Some theme settings are missing from your system, probably from the info file:

Since you have this: .container {width:}

Then these variables are not being populated:

$width = "\n" . '.container {width:' . $smartphone_portrait_layout_data['page_width'] . $smartphone_portrait_layout_data['page_unit'] . '}';

That's telling me you have something wrong with the default theme settings - that they are probably missing from the info file and/or database - have a check, they need to look like this - note the width and unit settings are the two that are probably missing or have some issue:

; Layout settings - Smartphone portrait
  settings[smartphone_portrait_layout]         = 'one_col_stack'
  settings[smartphone_portrait_page_unit]      = '%'
  settings[smartphone_portrait_sidebar_unit]   = '%'
  settings[smartphone_portrait_page_width]     = 100
  settings[smartphone_portrait_sidebar_first]  = 100
  settings[smartphone_portrait_sidebar_second] = 100
  settings[smartphone_portrait_media_query]    = 'only screen and (max-width:320px)'

Even if they are in the info file, are they actually in the database? Could be an artifact of upgrading at some stage that some or all of these settings failed to write to the database or are wrong, whatever, do a clean install if need be, they need to be in the info file and in the database (variable table).

2. In desktop first the CSS for smartphone portrait is too weak to override the desktop layout.

I have beefed this up and made it, fingers crossed, so this will never fail. Will commit shortly to DEV.

Desktop first has the least amount of testing to be frank, I know this, and am very happy for this bug report. I also realize its a bit weird how smartphone portrait layout is built, because I have been indecisive about how to handle it, whether to just hard code it, or leave some/all the dynamic features in place in case something changes fundamentally with mobile layouts in the next year or so (that's why its like this, to be mostly the same as the others - so the logic is there if we need to actually use it).

ogi’s picture

These settings were s:31:"smartphone_landscape_page_width";s:3:"100";s:30:"smartphone_landscape_page_unit";s:1:"%";s:31:"smartphone_portrait_media_query";s:33:"only screen and (max-width:320px)";s:30:"smartphone_portrait_page_width";s:0:"";s:29:"smartphone_portrait_page_unit";s:0:"";s:33:"smartphone_portrait_sidebar_first";s:0:"";s:34:"smartphone_portrait_sidebar_second";s:0:"";s:32:"smartphone_portrait_sidebar_unit";s:0:"";s:26:"smartphone_portrait_layout";s:0:""; in DB. The theme is created with RC1's starterkit so .info file is fine. I don't know how it ended like that. Smartphone landscape settings that are in exactly the same settings form web page are not affected. I fixed it by editing (with Firebug) input[type=hidden] fields in theme settings form and submitting it.

After fixing smartphone_portrait_* theme settings, everything seems to look fine without other issues. It looks like $layout = at_build_page_layout($smartphone_portrait_layout_data['layout'], $smartphone_portrait_layout_data['sidebar_first'], $smartphone_portrait_layout_data['sidebar_second'], $smartphone_portrait_layout_data['sidebar_unit']); didn't return anything with the empty/broken settings.

So now it looks to me that the only problem is how these settings for smartphone portrait are reset to empty strings.

Jeff Burnz’s picture

Title: Smartphone portrait in Desktop-first doesn't properly use one_col_stack » Smartphone portrait in Desktop-first needs more powerful selectors
Status: Active » Fixed

So now it looks to me that the only problem is how these settings for smartphone portrait are reset to empty strings.

Not really sure about that, no other user has reported such an issue and I its not reproducible. Put it down to teething issues during development, probably going to be chasing ghosts.

Jeff Burnz’s picture

Status: Fixed » Closed (fixed)

Cleaning up issue queue.