main navigation tabs database problems

RESOLVED FIXED

Status

Websites Graveyard
spreadfirefox.com
--
major
RESOLVED FIXED
11 years ago
7 years ago

People

(Reporter: asa, Assigned: Ian Hayward)

Tracking

Details

(Reporter)

Description

11 years ago
something in the database is causing the main navigation tabs to not show up as tabs.

Comment 1

11 years ago
This Warning appears in the status logs (https://sfx.stage.mozilla.com/admin/logs/status):

Database schema	Out of date
Some modules have database schema updates to install. You should run the database update script immediately.

Comment 2

11 years ago
Hi Erik

This page is showing an incorrect instruction . I know this is true because its saying that all my modules need updating :-) .

The problem has arisen because when this site was setup there was a problem with the time on the server which has now been corrected .

It also says on this page that the cron was last run 37 years 41 weeks ago (January 1970) the two problems are almost definitely connected.

If someone would take an archive of the database we could then try running the script .
In the meantime ill have a look again on the forums to see if there is something that we can simply reset in the database .

Regards Paul

Comment 3

11 years ago
Would you please confirm that an archive has been taken of the database before i run the database upgrade script .

Thanks Paul

Comment 4

11 years ago
If we can work together today to get this issue resolved that'll be great .

It needs to be resolved as we will need to be able to have confidence in using
the upgrade script in order that we can have confidence that were doing our v.best to keep the site secure.

Thanks Paul
(Reporter)

Comment 5

10 years ago
Morgamic, we're struggling with this one remaining major blocker on SFX2. Can you or someone on your team help us solve this problem?
I'm curious why we have to run this script on production to see if it fixes things?  Can't we get a database dump and update it on another machine to see if it works first?  Please don't run untested DB scripts on the SFX production database.

Paul -- what do you need to test the DB script locally first?

Comment 7

10 years ago
The database schema is up to date , this is no longer a problem .

Looking into the problem with the navigation tabs now ....
(Reporter)

Comment 8

10 years ago
Morgamic, Paul@glaxstar, this needs to be fixed ASAP.  We're trying to ship SFX2 and this is _the_ major blocker. 

Who can help?!
Paul, where are you stuck?  Please respond?
I can't get into sfx.stage.mozilla.com -- Paul, this is your responsibility -- what has been blocking this for over a month?  Where can I help?

Comment 11

10 years ago
Micheal | Asa, 

I responed to this problem on the 10th November @
https://sfx.stage.mozilla.com/node/170#comment-22
but i did not also update this ticket , apologies

Here is what i said there ...

"
Hello,

I was just having a look at how the old spreadfirefox theme  implemented the navigation tabs and i discovered that this is a feature of the phptemplate engine that the old spreadfirefox theme utilises .

I have had a quick look at the new spreadfirefox  theme and i don't see this phptemplate.engine file so i am not sure if this functionality is implemented at the moment . Or maybe it is using views ?

Erik would you please advise ??

Regards Paul
"

This will be something that will be handled by raincity as its an integral feature of the theme.

Paul



 
Fair enough, all I had was the bug.  Thanks.  I can take a look at this in the AM.

Comment 13

10 years ago
Thanks Micheal ,

Ill work through the others bugs today until they are done.


Comment 14

10 years ago
Asa, Perhaps we could add the "Main Navigation Tabs" links to the menu bar under a new menu entry "Navigation" ?

Paul

Comment 15

10 years ago
The issue is that the original "Primary Navigaiton" used a custom function to  add some extra classes and spans that the other navigation items don't adopt.

The extra markup is required to have flexible widths on the tabbed navigation (particularly for IE).

It is possible that the function could be re-written to apply to this new menu block. 

Our issue is that we don't have any PHP/coding resources that i can give to work on this. It's at least a couple hours of work.

My other concern is the question of "Why has the primary nav disappeared?". Is there an issue with the DB that caused this? Is his going to affect the ability to upgrade and maintain the website? I think these are questions that need to be addressed, and likely before the site becomes widely used.

Another temp solution would be to create a block with the necessary markup, and place this in the header. This of course does not address the above questions, and is not a good solution.

Erik


 

Comment 16

10 years ago
I will have a look at this today Erik but i would estimate that it will take me a little longer than 2 hours at least a day i would say. I'll let you know how i get on .

Paul
Assignee: erik → paul

Comment 17

10 years ago
Hi Paul, 

Thanks for looking at this. please let me know if you have any questions. I'll do my best to answer anything that comes up.

Thanks,
Erik

Comment 18

10 years ago
Hi Folks ,

I found some good lead here...

http://lists.drupal.org/pipermail/development/2007-May/023860.html
http://drupal.org/project/themesettings

The task is looking more manageable now that

1. i know that the phptemplate.engine comes with the DRUPAL5 core and that its looking as though additional forms we need to add are added with hook_settings() with the theme specific template.php
2. and hook_settings write all the form information automatically to the variables tables

I'll continue working on this. If you have any insights please add them here.

Regards Paul

Comment 19

10 years ago
Hello Erik / Asa ,

Experiencing a little difficulty in working out how to render the table layout of primary/secondary links textboxes on the Adminstration themes page . I only need to get over this one obstacle 
and i will not be far from done in sorting out the backend page . 

Please checkout the new spreadfirefox_RCS/theme-settings.php
file and the themesettingsapi API files. 

I think if you have time you could place the navigation links onto the page statically as it will be relatively straighforward to pick these up dynamically later .


Useful  link.
http://drupal.org/node/177868

Regards Paul

 

Comment 20

10 years ago
Hi Erik ,

If your around would you have a quick look at theme-settings.php page and see if you can figure out why all the textboxes are not being structured into tables .

I have included the code below for a quick inspection , i guess its something obvious here i have never had problems with tables before.

Thanks Paul


<?php

/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function spreadfirefox_RCS_settings($saved_settings) {
	
  //$settings = array_merge($defaults, $saved_settings);

		
  //$header = array(t('link text'), t('url'), t('description'));
  //$form = t('<p>DDue to incompatibilies in the handling of primary, and secondary links in PHPTemplate, these links need to specified seperately using the form below. Even though this is on the theme-specific configuration page, these settings will take affect in all themes using PHPTemplate.</p>');


  $form['spreadfirefox_RCS_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Due to incompatibilies in the handling of primary, and secondary links in PHPTemplate, these links need to specified seperately using the form below. Even though this is on the theme-specific configuration page, these settings will take affect in all themes using PHPTemplate.'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  
  $form['spreadfirefox_RCS_settings']['#theme'] = 'spreadfirefox_RCS_settings_theme'; 

 
  $form['spreadfirefox_RCS_settings']['header'] = array('#type' => 'value', '#value' => array(
    array('data' => t('link text')),
    array('data' => t('url')),
    array('data' => t('description'))
    )); 



  foreach (array('Primary') as $utype) {  // 'Secondary'
    //$rows = array();

    //Use $utype field , and strtolower() it to get the type field.. to avoid issues with ucfirst() and unicode.
    $type = strtolower($utype);

    //Increment the link count, if the user has requested more links.
    if (variable_get('phptemplate_' . $type . '_links_more', false)) {
      variable_del('phptemplate_' . $type . '_links_more');
      variable_set('phptemplate_' . $type . '_link_count', variable_get('phptemplate_' . $type . '_link_count', 5) + 5);
    }

    //Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format.
    $value = variable_get('phptemplate_' . $type . '_links', array());

    //Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
    $count = variable_get('phptemplate_' . $type . '_link_count', 5);
    $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
    if (variable_get('phptemplate_' . $type . '_link_count', 5) != $count) {
      variable_set('phptemplate_' . $type . '_link_count', $count);
    }

    for ($i = 0; $i < $count; $i++) {
      //$row = array();
      foreach (array('text', 'link', 'description') as $field) {
       //$row[] = form_textfield('', 'phptemplate_' . $type . '_links][' . $field . '][' . $i, $value[$field][$i], 15, 90);
       $form['spreadfirefox_RCS_settings']['phptemplate_' . $type . '_links[' . $field . '][' . $i.']'] = array(
       '#type' => 'textfield',
       '#default_value' => $value[$field][$i],
       '#size' => 15,
       '#maxlength' => 90,
     );

      }
      //$rows[] = $row;
    }
    //$form .= form_item(t("$utype links"), theme("table", $header, $rows), t('You can specify your _TYPE_ links here, one link per line.<br /> The link text field is the text you want to link.<br /> The url field is the location the link points to.<br /> The description field is an optional description of where the link points.', array('_TYPE_' => $type)));
    //$form .= form_checkbox(t('I need more _TYPE_ links.', array('_TYPE_' => $type)), 'phptemplate_' . $type . '_links_more', 1, FALSE, t('Checking this box will give you 5 additional _TYPE_ links.', array('_TYPE_' => $type)));

  }
  return $form['spreadfirefox_RCS_settings'];




}



function theme_spreadfirefox_RCS_settings_theme($form,$type='primary') {   print "Is this going to work or not ?" ;

  $phptemplate_type_links = 'phptemplate_' . $type . '_links' ;

    foreach (element_children($form[$phptemplate_type_links]['link']) as $key) {
      $row = array();
      $row[] = drupal_render($form[$phptemplate_type_links]['link'][$key]);
      $row[] = drupal_render($form[$phptemplate_type_links]['description'][$key]);
      $row[] = drupal_render($form[$phptemplate_type_links]['text'][$key]);
      $rows[] = $row;
    }
  
  $output .= theme('table', $form['header']['#value'], $rows);
  if ($form['pager']['#value']) {
    $output .= drupal_render($form['pager']);
  }

  $output .= drupal_render($form);

  return $output;
  }


Comment 21

10 years ago
Hello ,

I decided to just accept that all the textfields wanted to line up in columns for the time being .

There is now a final problem of getting the contents of the new form textfields stored in the 'variables' table which normally is handled automatically by the core with forms defined by hook_settings().

Would some some have a look in the database and let me now what entries there are for phptemplate* and let me know their values please .  

The two problems i have encountered probably indicate problems with the themesettingsapi API which sits between the drupal core and my code.

Can we just add the primary links into the theme template for the time being.
I don't want to hold everybody up here.

Apologies Paul
(Reporter)

Comment 22

10 years ago
Yes, if we can just hardcode in the primary links for the time being, that's good enough for launch. 

Erik, Morgamic, can you help Paul? Thanks.

Comment 23

10 years ago
I've committed the page.tpl and page-front.tpl files with the navigation hard coded to SFX.stage.

The one issue with this is relates to active states on the navigation. With the hard coded nav the active states are not output, so having them show as active when on the subsequent page was an issue.

To correct this i've added a function to template.php that outputs id's based on the page the user is viewing. This is being added on a extra div wrapping the navigation. I can then add some rules to apply the active state based on the page id. 

The css styles still need to be added for this, I'll be doing this once the change has been updated on the staging website (to insure i have the right page id's). 

I'll update when i have this working. please let me know if there are any questions.

Erik

Comment 24

10 years ago
Active states have been added.

Comment 25

10 years ago
Thanks Erik .

Comment 26

10 years ago
Erik,Please let me know when you want me to get these changes committed to SFX2 production .

There looks to be a problem with the 'Home' link when on the 'Home' page which is probably a drupal cache problem , would you take a look that .

Regards
Paul

Comment 27

10 years ago
Hey Paul,

Are you on PC or MAc, i assume using firefox? Can you post a screenshot?

Once none of us are seeing issues i'll be ok with this being pushed to production.

Erik

Comment 28

10 years ago
Hi Erik ,

I found the problem inside the template file sites/all/themes/spreadfirefox_RCS/page-front.tpl.php so i made the change and committed to SFX2 sandbox but forgot to update the ticket to let you know the problem was resolved ,apologies.

Morgamic,would you please push the changes to any files under  sites/all/themes/spreadfirefox_RCS/  to the SFX2 production server

Thanks again Erik.

Regards Paul 
Assignee: paul → ian-bugzilla

Comment 29

10 years ago
This is fixed, a while ago.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.