how to disable the fuel_notification messages when logged in temporarly or at all.

edited November 2011 in Modules
I posted in an old thread so though I would start over.

HI, I am also getting duplicate errors at the top and above the form. The user in this case will always be logged in, so I need the top screen errors to not show but i still need the errors above the form to show up. I am wondering what can be done? I am using similar code to the contact form and it is working bit I don't like the duplicate errors at the top like the other guy mentioned.

if I can disable even for when submitting forms it would help. What to do? Anyone have this issue?

// will set the values of the fields if there is an error... must be after set_fields
$this->form_builder->set_validator($this->validator);
$this->form_builder->set_field_values($_POST);
$this->form_builder->display_errors = TRUE;
$vars['form'] = $this->form_builder->render();

// use Fuel_page to render so it will grab all opt-in variables and do any necessary parsing
$page_init = array('location' => 'contact', 'render_mode' => 'cms');
$this->load->module_library(FUEL_FOLDER, 'fuel_page', $page_init);
$this->fuel_page->add_variables($vars);
$this->fuel_page->render();

Comments

  • edited 12:56PM
    This issue happens when the Validator object being used with the form_builder has it's property "register_to_globals" set to TRUE. When logged in, the inline editing part of FUEL looks for global errors and they get displayed at the top. If you set it to FALSE, I don't believe form_builder will display the errors either unless you change the form_builder "display_errors_func" property to point to a custom function other than the "display_errors()" function (found in the validator_helper). If you create your own, you can use the validator objects get_errors() method to return all the errors and display them as you want.
  • edited 12:56PM
    ok thanks. The only users using this will be the administrators with different levels of access. It seems this is not how you intended fuel to be used. So these global errors at the top are not wanted, but turning them off kills the error reporting as well.

    Is there a way to let people log in without considering them an admin so that it does not hook into the things like global errors? I will try though to manually display the errors if not through the validator.

    Thanks.
  • edited 12:56PM
    Unfortunately, there is not a way to associate users with turning off global validation errors so I think your best bet would be to create your own function that generates the errors.
Sign In or Register to comment.