Closed (won't fix)
Project:
TableField
Version:
7.x-2.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
27 May 2012 at 04:14 UTC
Updated:
15 Feb 2017 at 12:10 UTC
Jump to comment: Most recent
function tw_form_production_node_form_alter(&$form, &$form_state) {
//see($form);
$access = user_access('administer nodes');
$form['path']['#access'] = $access;
$form['menu']['#access'] = $access;
$form['author']['#access'] = $access;
//$form['options']['#access'] = $access;
$form['comment_settings']['#access'] = $access;
$form['revision_information']['#access'] = $access;
$form['field_helen_hayes_recommended']['#access'] = $access;
$form['field_show_schedule']['und'][0]['tablefield']['rebuild']['#title'] = "Change number of rows";
if (isset($form['field_show_schedule']['und'][0]['tablefield']['rebuild']['count_cols']))
$form['field_show_schedule']['und'][0]['tablefield']['rebuild']['count_cols']['#access'] = FALSE;
}
This does not work. Well it works but when users do a "Rebuild" they get a no index 'count_cols' error. ('#disabled' = TRUE also give sthis error) I'm trying to turn off the ability of the data entry person altering the number of cols but still alter the number of rows. Will I have to be satisfied just using a validation and checking the number of columns?
Comments
Comment #0.0
donpwinston commentedadd more complete explanation as to what happens
Comment #1
lolandese commentedHave a look at the Table Element module that is intended to provide a provide a form element .