Drupal call to undefined function when creating user - drupal-7

I'm getting this error message when creating new user trhough admin/people/create/:
Fatal error: Call to undefined function feitoervas_form_validate() in /home/feitoervas/www/novo/includes/form.inc on line 1513
I have a function feitoervas_form_validate() defined on template.php in sites/all/themes/feitoervas/, but it shoundn't be used only on theme pages? Admin theme is seven.
The error also happens if I disable the theme or even delete it. Tried to update drupal, but didn't solve the problem.
Drupal version is 7.34.

You can add a hook like this:
function CHANGEYOURTHEME_your_node_form_submit($form, &$form_state) {
feitoervas_form_validate();
}
So you will validate the form only at submit.
I hope this helps.

Related

Azure b2c throwing undefined error which is vague error and should be user/email exists error?

this undefined error is thrown by Azure B2C when i try to signup an existing user can i fix this issue somhow?
Workaround
To workaround this issue and display the correct error message, you can do the following:
If you haven't already, follow these steps to add a custom HTML template for the page.
If you haven't already, follow these steps to enable JavaScript in your custom template.
In the B2C authentication screens, open the browser dev tools and reproduce the error that causes "undefined" to be displayed. Then, locate the last network request and inspect the response JSON, noting the errorCode and message properties.
Add the following script to the bottom of your custom HTML template (inside the <body> tag), replacing the error code and message with the one from your devtools. If you like, you can also customise the error message.
<script type="text/javascript">
if (CONTENT) {
CONTENT['UserAccountNotFound'] = CONTENT['UserAccountNotFound'] ?? 'A user with the specified credential could not be found.'
}
</script>
Upload the updated HTML template, and the correct error message should not be displayed.
Explanation
It seems that undefined is being displayed due to Microsoft having a bug in the page's JavaScript. The variable u is initially set to the correct message, while f is set to the string 'undefined' as the errorCode is not found in the page's lookup dictionary. Then the next line contains u = f which results in the string 'undefined' being printed as the error.
To workaround this, we need lookupLanguage to return the correct string. To do this, we need to add items to the page's lookup dictionary, which helpfully is a global variable named CONTENT that can be easily modified in a custom script.
In the future, Microsoft will hopefully fix this bug so that the workaround will no longer be needed.

react-final-form validation not work with debounce

I wrote simple async validation use react-final-form
In field username I typed john and show error Username taken!
I want to add debounce function from lodash library.
I typed john and couldn't see error add one symbol and error appear
When one symbol was removed (input value is john) error disappear
It's look like something is cached
Please help me understand my issue
FYI
I created simple application :
https://codesandbox.io/s/react-final-form-asynchronous-field-level-validation-example-iljh1?file=/index.js:477-492

Undefined not a function - Drupal 7 - JQuery Dialog - No UI CSS

I have followed tutorials such as this one and this one. At first glance they are quite simple as in how to add JQuery UI to Drupal 7. Nonetheless, when I apply them, all I get is that the function dialog is undefined. Here is what I have done:
template.php
function mytheme_preprocess_image(&$variables) {
drupal_add_library('system','ui.dialog');
}
chat_overlay.js
jQuery(document).ready(function(){
console.log("*********************Setting up click");
jQuery('#small_chat_wrapper #chat_message').click(function(){
console.log("*********************CLICKED CLICKED");
if (typeof jQuery.ui !== 'undefined')
console.log("loaded");
else
console.log("undefined");
jQuery('#chat_overlay').dialog('open');
});
})
The console logs print out wonderfully, and the if check prints out loaded. Nonetheless, when it gets to the line of .dialog(..) the Undefined error occurs. I don't know what else to try. Such a simple thing and it's becoming painful.
Help is very much appreciated.
Edit:
The site's Status Report has the following:
jQuery Update jQuery 1.7.1 and jQuery UI 1.8.7
My MISTAKE:
Change function mytheme_preprocess_image(&$variables) to function mytheme_preprocess_page(&$variables) . Goodness.
Now the UNDEFINED ERROR NO LONGER happens, BUT, even though the ui classes and divs are getting added, the UI CSS is not coming through (the dialog does not pop up).
Really would appreciate some help.
You should load the jquery library that you need either in the preprocess_html function of your template.php or in yourmodule_init hook like that:
<?php
function yourmodule_init(){
drupal_add_library('system', 'ui.dialog');
drupal_add_library('system', 'ui.draggable');
drupal_add_library('system', 'ui.sortable');
}
?>
The source: https://www.drupal.org/node/1172846

getting error call to undefined function webform_component_edit_form_validate in ctools popup drupal 7

I am using webform module for creating form. I required not to customize webform_component_edit_form. so
I have alter webform_component_edit_form. In this form alter i add select element with #ajax property. This is working fine when i open this in url. But when i open this form in ctools i am getting error
Call to undefined function webform_component_edit_form_validate() in ../includes/form.inc
webform_component_edit_form_validate i written in webform/incluedes/webform.components.inc
any one can suggest me where i am doing mistake.
It exists in webform/includes/webform.components.inc, so maybe it is not getting included since you are integrating it with a form alter.
Try adding this to your form alter, above the form item you are modifying.
require_once drupal_get_path('module', 'webform') . '/includes/webform.components.inc';
I use
module_load_include('inc', 'webform', '/includes/webform.components');
in above of my module.
now its working fine.

CakePHP: Passing data to plugin

I have installed a plugin (SignMeUp) for the user registration, and according to the documentation the registration function inside my User Controller has to look something like this:
public function register() {
$this->SignMeUp->register();
}
Looking at the $this->data array inside this function shows that everything is working fine. However, when I use
debug($this->data);
inside the registration() function of the plugin (the one I just directed my function to), the array is empty. Somehow the data doesn't get passed on. What could be the cause?
Resolved! This can be solved by replacing all the $this->data occurences in the SignMeUpComponent with $this->controller->request->data
It's a change from Cake 1.3 to Cake 2.x

Resources