This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

forms_api updated - what's "Cannot create references to/from string offsets nor overloaded objects"

I've tried updating a few modules to the new forms_api now, and I get stuck at the same point every time. I update all the arrays, set up the new hook, and every time I end up with the following error:
Fatal error: Cannot create references to/from string offsets nor overloaded objects in $my_drupal_dir/includes/form.inc on line 312

Here's an example of an update of the forms_api for the Donations module:
<?php
// Implementation of hook_settings()
function donations_settings()
{
$url_donorge = D_URL_DONORGE;
$donorge = "Donorge";
global $base_url;
$site_name = variable_get('site_name', 'drupal');

$form["donorge_default_item_id"] = array(
'#type' => 'textfield',
'#title' => "What is the item ID of your donation item as listed on Donorge?",
'#default_value' => variable_get('donorge_default_item_id', 1),
'#size' => 10,
'#maxlength' => 10,
'#description' => "",
);

$d_adminblock = l("enable a donation block", "admin/block");
$default_block_subject = variable_get('donorge_block_subject', "support $site_name");
$output .= "Optionally you can $d_adminblock which will make it allot easier for your visitors to donate to your item via your own site. Typically you should always enable the donation block on your site unless you want to manually take care of the donation button on your site.";
$form["donorge_block_subject"] = array(
'#type' => 'textfield',
'#title' => "Title of the donation block (optional)",
'#default_value' => variable_get('donorge_block_subject', $default_block_subject),
'#size' => 40,
'#maxlength' => 80,
'#description' => "",
);

$form["donorge_block_text"] = array(
'#type' => 'textarea',
'#title' => "This text appears on top of the donation button in the donations block (optional)",
'#default_value' => $default_block_text,
'#cols' => 64,
'#rows' => 8,
'#description' => "",
);

for($i = 1; $i < 19; $i++)
$options[] = $i;
$form["donorge_button_id"] = array(
'#type' => 'select',
'#title' => "Select the look of the donation button",
'#default_value' => variable_get('donorge_button_id', 1),
'#options' => $options,
'#description' => "",
);

$output .= "

";
for($i = 1; $i < 10; $i++) {
$ii = $i + 9;
$output .= "

";
}
$output .= "

$i. Only local images are allowed. $ii. Only local images are allowed.

Adding block_hook to my module causes ALL blocks to vanish...??

If I enable this function in my tapestries.module, all the blocks on my page just vanish. I stripped the function down to the point it does not actually DO anything, other than break the site. They still show up in the block configuration page, they just fail to display.

Check if the body has changed in node_update() - let's see if anybody knows this one!

Hello,

As many of you guys know :-) I am developing article_node.module. It's a node module that "enhanches" the normal node, so that peer reviewing can actually happen.

As you probably all know, I developed my own node_article_update($node) that does all the right stuff.

Now: I absolutely NEED to know if the body of the article has changed or not. This is very crucial, because I have to know if an author has actually changed an article (if s/he has, the article will go back to the editing pipeline).

Display day name in Event calendar instead of just date

Working on the event.module to make it look nice with my theme. Can anyone help me figure out how to output the day name for each calendar event date? I think, through my unethical frankenstein-like experimentation with the events.theme file, that this is the relevant chunk of code that I need to edit to make the day name appear.

Right now it writes the numerical date (03/18 or 03/19) and I need it to also write the name of the day (Friday 03/18 or Friday, Mar 18).

flatten user profile modifications to one page (no secondary_local_tasks)

Hi Drupalers,

I've got my form setup for modifying a user profile such that all the information that is driven by the profile module is showing up under the default secondary local task. ie: the user does not have to click on the sub links when editing their info...from http://foobar/user/12/edit.

My problem is that I can't seem to get the information back into the database...I've used hook_form_alter on the 'user_edit' form_id to modify the form. I'm able to get all the default_values into each field. I'm then tried using hook_user to simulate the action that takes place when the user hits 'save my settings'

Can anyone provide any help?? Here is my hook_user function. I've added the drupal_set_message function and what is odd is that when I attempt to save my settings the only output I get is "For 12, a load operation was invoked.
For , a categories operation was invoked.
For 12, a load operation was invoked.
For 12, a form operation was invoked.
For , a validate operation was invoked. "

is this expected???


function mymodule_user($type, &$edit, &$user, $category = NULL) {
// print "$type";
drupal_set_message("For $user->uid, a $type operation was invoked.");
switch ($type) {
case 'update':
case 'insert':
printArray($edit);
return profile_save_profile($edit, $user, $category);
break;
case 'validate':

URL field in flexinode Problem, changes http:// to http://http//

I know I found the solution for this problem before, but I can't find the post. But pretty much whenever I submit a URL in the URL field in Flexinode, like this "http://drupal.org/node/" it outputs as "http://http//drupal.org/node/". inserting it "drupal.org/node/" makes the link work. (this flexinode type was not themed)

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions