drupal 7 include site wide contact form in a node - drupal-7

I want add the Site Wide user form a node.
I used Drupal 7.
The site wide form Id-s: contact_site_form ( I get it from from.inc )
With alter I altered the form content.
in the node code:
php code:
print drupal_render(drupal_get_form('contact_site_form'));
Error message:
Notice: Undefined index: contact_site_form drupal_retrieve_form() függvényben (D:\wamp\www\online_recruitment\includes\form.inc 766 sor).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'contact_site_form' was given drupal_retrieve_form() függvényben (D:\wamp\www\online_recruitment\includes\form.inc 802 sor).

I found the answer:
http://drupal.org/node/237559#comment-780448 -> D6 way but worked in D7 as wel
php: require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';
it worked like a charm.

Related

Getting deleted users from Active Directory using Java JNDI

I want to get all details of AD users which are being deleted .
As per my info when users are deleted from Active Directory they are stored in container with CN=Deleted Objects
Now When i search Users with searchBase = "DC=domain, DC=local".Everything works fine and i get data for all users with their name , mobile etc.
But when i apply searchBase ="CN=Deleted Objects,DC=azdomain, DC=local" i get error as
javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of:
'CN=Deleted Objects,DC=azdomain, DC=local'
what does this error means ? , Also i am not able find any post related to same issue on internet .
Please help me with this .

Drupal Domain Access module Settings Tab White Screen of Death WSOD

In the Drupal 7.x project I'm developing, I'm using Domain Access module.
Somehow, when I try to access the Settings tab (admin/structure/domain/settings) I get a WSOD.
ERROR LOG:
[Wed May 07 11:20:08 2014] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function object_log() in /var/www/MYDRUPALPROJECT/sites/all/modules/custom/domain_bonus/domain_bonus_login_restrict/domain_bonus_login_restrict.module on line 55, referer: http:// MYDRUPALPROJECT/en/admin/structure/domain
Content from the file in question:
......
/**
*Implements hook_form_alter().
*/
function domain_bonus_login_restrict_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
.....
// Provide option to enable / disable restriction on domain settings form.
case 'domain_configure_form':
(LINE 55:) object_log('form_id ' . time(), $form_id);
.....
This custom module is a copy of the contrib module with just some simple modifications that don't involve the line in question.
Anyone have any idea what can be the cause of this?
Should I share any other relevant information to help you understand this?
Thank you!
Solved!
The problem was that the contrib module Domain Bonus: Login Restrict comes with the following lines of code:
object_log('form_id ' . time(), $form_id);
object_log('form_state ' . time(), $form_state);
object_log('form ' . time(), $form);
Those lines are used to debbug, probably during the module development.
object_log() function is a function from the object log module that can be used to debbug, more specifically to check variables value in a specific part of the code.
Since in the module .info file isn't defined that the Domain Bonus: Login Restrict module depends on the Object Log module, the Object Log module wasn't even installed in our project... In that conditions when reading that line, Drupal crashes.
So, for this function to work Object Log module needs to be installed, this module needs Devel module to work. Or simply just comment or delete those lines.
Cheers.

Drupal 7 - Theme Info Name Errors After Transferring Site to New Server

After transferring over a finished site to a new server, files/database and all, switching over the database settings in settings.php and running update.php I get the following errors:
Notice: Undefined index: name in block_menu() (line 146 of /home/nrsc2533/public_html/modules/block/block.module).
Notice: Undefined index: name in block_menu() (line 165 of /home/nrsc2533/public_html/modules/block/block.module).
Notice: Undefined index: name in system_menu() (line 647 of /home/nrsc2533/public_html/modules/system/system.module).
Notice: Undefined index: name in block_menu() (line 146 of /home/nrsc2533/public_html/modules/block/block.module).
Notice: Undefined index: name in block_menu() (line 165 of /home/nrsc2533/public_html/modules/block/block.module).
Notice: Undefined index: name in system_menu() (line 647 of /home/nrsc2533/public_html/modules/system/system.module).
I also lose most if not all of the items in the admin menu. I looked up the errors and they were all related to the following line of code:
'title' => check_plain($theme->info['name']),
This is a free theme that I customized, it is working fine on my test domain on my server, but not now that it has transferred. I did change the [theme].info file to reflect that it had been customized on the "name =" line. I checked online and found that the encoding may have been changed when I saved it, again strange since I had done this on the test domain and it seemed fine, so I changed the encoding to UTF-* without BOM and still to no avail. I have tried clearing the cache again via update.php and nothing changes. Any help will be GREATLY appreciated.

node_load($nid) gives me a fatal error in Drupal 7

Pretty new to drupal 7 and a lot has changed. How can I simply load a node and print it out? I am using the following but the function node_load gives me: PHP Fatal error: Call to undefined function node_load()
$node = node_load(15);
echo '<pre>' . print_r($node,1) . '</pre>';
it sounds like it cant find the function node_load - which i can imagine only happening if you were trying to do this outside of the drupal framework? e.g. on a PHP page youve simply added into the webspace?
contents of file:
<?php
node_load(1);
make sure you have the node_load inside a drupal module you have created, and when its responding to a hook ( e.g. hook_view )
sites > all > modules > yourmodule
yourmodule.module
yourmodule_view($node, $view_mode){
node_load(1);
}

CakePHP "Warning: Cache not configured properly"

I am using CakePHP and getting the following error
Warning: Cache not configured properly. Please check Cache::config(); in APP/config/core.php in D:\PHP-SERVER\cheesecake\cake\libs\configure.php on line 663
Notice: Undefined variable: Route in D:\PHP-SERVER\cheesecake\app\config\routes.php on line 38
Fatal error: Call to a member function connect() on a non-object in D:\PHP-SERVER\cheesecake\app\config\routes.php on line 38
Any problem in the settings?
Which CakePHP version are you using?
The fatal error looks like a typo. Open the file D:\PHP-SERVER\cheesecake\app\config\routes.php and check what there is written on line 38. It looks like there is a letter missing.
It should be something along the lines of
Router::connect(...[whatever your route settings are]...);
and I guess in your file it says (note the missing r in Router)
Route::connect(...);
Did you do what the other error message said? Check the Cache::config call in app/config/core.php. You seem to have not properly set your cache configuration.
The default call looks like
Cache::config('default', array('engine' => 'File'));
If you changed that post the code-piece to figure out if something is wrong..

Resources