Hi...I have certain fields enabled for registration, while other are set to hidden. I also use Field Groups in which the registration field is displayed. After registration I get the following error.

warning: strtr() [function.strtr]: The second argument is not an array in /home/.author/site/modules/syslog/syslog.module on line 106.
warning: syslog() expects parameter 1 to be long, string given in /home/.author/site/modules/syslog/syslog.module on line 79.

Regards,

Marius

Comments

fago’s picture

Category: support » bug

I suppose the call to watchdog() is wrong.

kenorb’s picture

followed watchdog call should be converted to Drupal 6.x syntax

watchdog('content', t('Content Profile: added %user %type upon registration.', array('%user' => $node->name, '%type' => $type)), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
watchdog($type = 'content', $message = 'Content Profile: added <em>asdasdasda</em> <em>company</em> upon registration.', $variables = 5, $severity = '<a href="/parent/asdasdasda">view</a>', $link = ???) at content_profile_registration.module:198
kenorb’s picture

comment line with the watchdog() call, or replace with:

	$drupal_ver = VERSION;
	switch ($drupal_ver[0]) {
	    case 5:
		watchdog('content', t('Content Profile: added %user %type upon registration.', array('%user' => $node->name, '%type' => $type)), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
		break;
	    case 6:
		watchdog('content', t('Content Profile: added %user %type upon registration.', array('%user' => $node->name, '%type' => $type)), NULL, WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
		break;
	}

This should work on both version of Drupal (5 and 6).

niklp’s picture

Can you make a patch for that please...? :)

kenorb’s picture

In attachment, it's for development version.
If it will not work, download whole file here: http://drupal.org/node/313341#comment-1050831 with some additional patches.

david lesieur’s picture

Status: Active » Needs work

It is not necessary to support both 5.x and 6.x — this module only targets 6.x.

kenorb’s picture

Sometimes people wants to back port some modules to D 5.x, so they will see the different and they will have less mistakes and converting:)
Any way you can use only this line:

watchdog('content', t('Content Profile: added %user %type upon registration.', array('%user' => $node->name, '%type' => $type)), NULL, WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));

for Drupal 6.x only

niklp’s picture

In which case... can you please post a patch that fixes the module for D6 only, because it's really irrelevant to tackle anything related to D5.

kenorb’s picture

Put the NULL argument before WATCHDOG_NOTICE argument. And that's it.
It will take less time than creating and applying the patch.
At the moment I've patched half of the module, so I can't generate it at the moment.

kenorb’s picture

Another change
There shouldn't be any t() function
http://drupal.org/node/114774#watchdog_parameters
So it should looks like:

watchdog('content', 'Content Profile: added %user %type upon registration.', array('%user' => $node->name, '%type' => $type), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
jgraham’s picture

Status: Needs work » Fixed

thanks kenorb

Status: Fixed » Closed (fixed)

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