Hook_form_alter() used for content types

I am developing a new module that is used spacifically to alter how a content type is published. What I must have is a tool that can change the nature of selected content-types. I am having a newby type issue right now so I will not go to deep into the function of the module.

My issue right now is that I cannot see my module link on the sidebar of the content-type. I open up the content type "Basic Page" and on the left side bar under the link "Menu settings" I should see a link to my module. But it does not happen. I am sure I am doing something wrong. What am I missing?

/**
*  Implimentation of HOOK_form_alter()
*/
function my_module_form_alter(&$form, $form, $form_state, $form_id) {
   if ($form_id == 'node_type_form'
      &&
      $form['#node_type']->type == 'TYPE') {
         $form['MY_module'] = array (
            '#type' => 'fieldset',
            '#attributes'=> array('class' => array('bms-fieldset')),
            '#title' => t('My Module'),
            '#group' => 'additional settings',
            '#collapsible' => TRUE,
            '#collapsed' => TRUE,
        ),
   }
}

I noticed that I have not set any access or permission conditions so that the administrator can see the link. This might also contribute to the issue. I do not know how to add this function to the code or if I need it.

Can't Change Email Address

Hello,

I'm trying to change the email address in Configuration/System/Site Information, the automated one. I change it and click save config, on the top it says the "configuration options have been saved" but then the email address changes back to what I had before and it is still the one that sends out the automated message. Everything else can be changed on that page except email. Is there a code I need to change, or a feature I need to disable. Thanks.

Custom submit handler - calculated field values based on user input (SOLVED)

I have two fields in question, field_in and field_cm. The user is presented with one or the other (based on roles rule only one filed is shown, the other one is hidden). The form is created via admin - a custom content type form.

Problem: trying to populate the hidden field based on the user input in the visible field - the value is not saving to the db.

I added a custom submit function to the normal node_form_submit to handle the calculation, but it does not seem to add data - I do not see anything in the db. What am I doing wrong?

<?php

/**
* Implements hook_form().
*/
function my_module_form_alter(&$form, &$form_state, $form_id) {
if( $form_id == 'reading_node_form') {
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Add Reading'),
'#weight' => 50,
'#ajax' => array(
'wrapper' => 'reading-node-form',
'callback' => 'my_module_callback',
'clear' => TRUE,
'effect' => 'fade'
),
'#submit' => array('calculate_values_submit','node_form_submit'),
);
}
return $form;
}

function my_module_callback($form, &$form_state) {
$node = new stdClass();
$node->type = 'reading';
return drupal_get_form('node_form', $node);
}

function calculate_values_submit($form_id, &$form_state) {
$form_state['rebuild'] = TRUE;

CSS Aggregation Error

So I'm experiencing a funky error with Drupal 7's built in CSS aggregation. I inherited this project from a contractor at work. He built the site out, with some help from the regular employees. I have some issues (lots) with the way it was done (he was totally new to Drupal when he started, and didn't read any tutorials or anything, so it's... messy, that's a good word), but it works, more or less.

Here's the problem: Whenever I turn CSS or JavaScript aggregation on, styles are no longer loaded. Now, the files are being generated, and I can even open them for editing in my IDE or if I download them in Notepad++. However - when I go to "View Source" in Firefox and click the link to the CSS or JS file, I see a jumble like this:

��������W�n�6����Pgj;M/qe�Ţc���I�I;��>J����D~$?^�0�+���2i��5T�,�mK�r_<��������UH�����+y�'yD�e����d�;�>�A4#ks
�#k�@bU[�cOH*��]%���=rf�b�r��=J�i�C3��|_j��\���m��[g��&T�3����d�\OKմ�kY��c�4T 7=QN��A�4t���-~��cI�V�Y�o�3�B�4����{`�N@W�tr��N �H�?��A4�0;f����B���TB��n�^�w�� ϸ�h�u��5�F� G������ ��u�i��s�ZA?��P�۩�r_x��*Cޏ5�� n �TGM� LR�h�-��Z$+Z����?�M����������B`ixw�4�H���1��0�p��`�m�q�Z��4T����CQ��N�D����%��Θ���:m@�!9�1XF��V'+��W]H�ǐ��U���

Preprocessing function - how to add a class to block title based on region

I am trying to add a class to the block title of blocks in a certain region. Although some information is added to the HTML, it stands alone and is not included in the class="". See HTML output below:
<h2 class="block-title" 0="invisible-elements">Navigation bar top</h2>

I am using a fresh Drupal 7.2 installation with a Zen Theme. My startertheme is named "test". The name of the region is "navbar_top". I included the following code into my template.php.

Error 330

Hi,
I get Error 330 (net::ERR_CONTENT_DECODING_FAILED) on PHP 5.3 when installing.
What can I do? I've tried on PHP 5.2 but it's the same
Thanks

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x