Hi jthorson!

I am trying the registration process and i discovered a problem.

When i register a team with my admin account, the team is registred with no problems.

When i am trying to create a new team with another account (not admin), all to seems to work well, but the team doesn't appear in the teams list!

Do you see what is the problem ?

CommentFileSizeAuthor
#6 jthorsonscreenshot.jpg120.9 KBMasterChief
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jthorson’s picture

Status: Active » Closed (duplicate)

Please verify that you are using the latest version of the software.

There were two related issues which were preventing teams from appearing in the team list ... for example, see #1085868: Create Team with authenticated user not showing up in league team list.

jthorson’s picture

Just for clarities sake (and to avoid having to dig through the queue), this problem can arise if you are not using the latest -Dev version of the Date module ... and is indirectly related to #1075530: Adding (or editing) a team after enabling 'ult_registration' results in mysqli_real_escape_string() warning.

MasterChief’s picture

Hi again jthorson!

I am using the latest version of ULT and 6.x-2.x-dev of Date.

So it's another problem and i check my logs i don't have an error message :(

An idea for this problem ?

jthorson’s picture

Can you attach a screenshot of your ult_team content type from admin/content/node-type/ult-team/fields?

jthorson’s picture

Status: Closed (duplicate) » Active
MasterChief’s picture

FileSize
120.9 KB

I am attaching the screenshot :)

If you want me to do some tests i am on irc #drupal

jthorson’s picture

K ... you've got all the correct fields ... In the database, what is the value of the 'field_ult_teamparent' column for that particular team?

MasterChief’s picture

I checked the database and the value of field_ult_teamparent_nid is 6.

jthorson’s picture

Can you provide an export of your ult_teamlist view?

MasterChief’s picture

Here the export of ult_teamlist view :

$view = new view;
$view->name = 'ult_teamlist';
$view->description = 'A listing of the ULT Teams created on this site ';
$view->tag = '';
$view->base_table = 'node';
$view->human_name = '';
$view->core = 0;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['css_class'] = 'ult-teamlist';
$handler->display->display_options['items_per_page'] = 0;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'table';
/* Empty text: Global: Text area */
$handler->display->display_options['empty']['text']['id'] = 'area';
$handler->display->display_options['empty']['text']['table'] = 'views';
$handler->display->display_options['empty']['text']['field'] = 'area';
$handler->display->display_options['empty']['text']['label'] = '';
$handler->display->display_options['empty']['text']['empty'] = FALSE;
$handler->display->display_options['empty']['text']['content'] = 'No teams have yet been created in this league/division.';
/* Field: Node: Nid */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['exclude'] = TRUE;
$handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['nid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['nid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['nid']['alter']['html'] = 0;
$handler->display->display_options['fields']['nid']['hide_empty'] = 0;
$handler->display->display_options['fields']['nid']['empty_zero'] = 0;
$handler->display->display_options['fields']['nid']['link_to_node'] = 0;
/* Field: Node: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 1;
$handler->display->display_options['fields']['title']['alter']['path'] = 'ult/team/[nid]';
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 0;
/* Sort criterion: Node: Title */
$handler->display->display_options['sorts']['title']['id'] = 'title';
$handler->display->display_options['sorts']['title']['table'] = 'node';
$handler->display->display_options['sorts']['title']['field'] = 'title';
/* Argument: Content: League/Division (field_ult_teamparent) */
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['id'] = 'field_ult_teamparent_nid';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['table'] = 'node_data_field_ult_teamparent';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['field'] = 'field_ult_teamparent_nid';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['style_plugin'] = 'default_summary';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['validate_type'] = 'node';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['validate_options']['types'] = array(
  'page' => 0,
  'story' => 0,
  'ult_division' => 0,
  'ult_league' => 0,
  'ult_team' => 0,
);
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['validate_fail'] = 'empty';
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['break_phrase'] = 0;
$handler->display->display_options['arguments']['field_ult_teamparent_nid']['not'] = 0;
/* Filter: Node: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'ult_team' => 'ult_team',
);
$handler->display->display_options['filters']['type']['expose']['operator'] = FALSE;
$translatables['ult_teamlist'] = array(
  t('Defaults'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('No teams have yet been created in this league/division.'),
  t('Nid'),
  t('Title'),
  t('ult/team/[nid]'),
  t('All'),
);
jthorson’s picture

The module has only been tested with Views 2 ... if you want to use View3 (alpha), I'm afraid you're on your own from a debugging point of view, as I don't have any experience with it.

From a support perspective, I'm willing to support the 'recommended' version of integrated modules ... but it's difficult to develop integration for modules as complex as views, especially if there is no developer documentation (which is the case for D6 and Views 3).

MasterChief’s picture

Hi jthorson i found what is the problem and it's not views!

The value of field_ult_teamparent_nid is 6 but it must be 670 on my install !!!

The problem is when i register in another league the value stay at 6, maybe the value is cut or another thing ?

I see another strange thing and i think it's linked, when i check a team create by an authenticated user i don't see the field League/Division on the team page.

I tried to enter 670 and the team appears in the list, so the value is wrong :(

jthorson’s picture

Well ... that would certainly explain the symptoms ... whatever is truncating the value in your database would likely also interfere with the cck field validation; which would result in the field not being displayed on the team page.

As for why the field is being truncated, I don't even have a guess ... my suggestion would be to install the devel module, go into the code where the node is initially saved, and add a "dpm($node);" line directly before the node_save command ... if the field value is correct there, but isn't correct inside the database; then you've got me stumped.

As for where you would need to add this debug code, it depends on which ULT modules you have installed. Can you provide the list of ULT modules which are active, so that I can direct you to the appropriate file/line number? (Alternatively, what is the sequence of links that you are clicking on in order to create the team ... is it "Registration"->"Click here to add a new team", or simply an "Add Team" tab at the top of the league page?)

MasterChief’s picture

I activated all modules except ult waivers.

I am clicking in a division on registration => click here to add a new team

jthorson’s picture

I can't see anything that could be causing your symptom ... The code automatically sets the 'team parent' value when it builds the form, and I depend on Drupal's internal functionality to store the value ... There's really nowhere that I can see how the code could break in the way you describe.

As far as troubleshooting, install the devel module and add some debug statements.

ult_main.module (around line 326)

      if ($form['nid']['#value'] == '') {
        // Retrive parent nid if specified
        // URL: ult/league/%nid/newteam or ult/division/%nid/newteam
        if ((arg(0) == 'ult') && ((arg(1) == 'league') || (arg(1) == 'division')) && (is_numeric(arg(2))) && (arg(3) == 'newteam')) {
          $parentnid = check_plain(arg(2));
          $parenttype = _ult_main_getnodetype($parentnid);
          // Verify parent league/division node type
          if ($parenttype != 'ult_' . check_plain(arg(1))) {
            drupal_not_found();
            exit();
          }
          // Update parent league/division in form
          $form['field_ult_teamparent']['#value'] = array('nid' => $parentnid);
          $form['field_ult_teamparent']['#after_build'][] = '_ult_main_hideelement_afterbuild';
        }
      }

Add a line after $parentnid = check_plain(arg(2));

      if ($form['nid']['#value'] == '') {
        // Retrive parent nid if specified
        // URL: ult/league/%nid/newteam or ult/division/%nid/newteam
        if ((arg(0) == 'ult') && ((arg(1) == 'league') || (arg(1) == 'division')) && (is_numeric(arg(2))) && (arg(3) == 'newteam')) {
          $parentnid = check_plain(arg(2));
          dpm($parentnid);                                                              // <--- ADD THIS
          $parenttype = _ult_main_getnodetype($parentnid);
          // Verify parent league/division node type
          if ($parenttype != 'ult_' . check_plain(arg(1))) {
            drupal_not_found();
            exit();
          }
          // Update parent league/division in form
          $form['field_ult_teamparent']['#value'] = array('nid' => $parentnid);
          $form['field_ult_teamparent']['#after_build'][] = '_ult_main_hideelement_afterbuild';
        }
      }

Or use a hook_form_alter routine to add a custom validation handler, and use it to make sure the proper team_parent value is getting passed on when the form is submitted ...

Or maybe you have another module that is interfereing ... disable all other modules (except those required by ULT) and see if the problem persists ...

Other than that ... without direct access to your site/code, I don't know how I can help further.

MasterChief’s picture

I add the line for devel and the value display is right.

When it's not an admin the league/division value doesn't want to be save correctly, if i am going with an admin account on the same team just click edit team info and save => it works!

the field_ult_teamparent field is a select list maybe it's the problem ?

EDIT :

I just install the new version and now it works you changed something which fixed the problem in your 7th may commits, what i don't know but something was the problem. Really strange, do you see what you done made an effect on this ?

jthorson’s picture

Status: Active » Fixed

Nope ... I haven't changed anything that would affect this ... it's more likely that something was corrupted (code, a view, whatever), and in installing the most recent version corrected it.

In any case, glad to hear it's working!

MasterChief’s picture

Me too because i was going to be totally crazy lmao :)

Status: Fixed » Closed (fixed)

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