J3 Issue ?
avatar mixahlos
mixahlos
29 Oct 2018

Steps to reproduce the issue

In Global Configuration, set the New User Account Activation
to None
Then try to register a new user.

Expected result

The user is created with no errors or warnings

Actual result

The user is created with the following errors/warnings
Warning :
Message
The mail function has been disabled by an administrator.

Error :
An error was encountered while sending the registration email. A message has been sent to the administrator of this site.

System information (as much as possible)

apache 2.4.18-2ubuntu3.9
Joomla 3.8.13

Additional comments

I am in a localhost and do not have mail setup. So I understand why I get those errors.
The problem is that I am developing a component and in my controller I call the register() method
of the UsersModelRegistration.
Because there is no mail in my system the method returns false which is not true because the user is created.
The point is that since the New User Account Activation is set to None and the user is created then the returned value from the UsersModelRegistration::register method should return true (even with warnings) because the requested action (user registration) is completed.

In the UsersModelRegistration :

	public function register($temp)
	{
		$params = JComponentHelper::getParams('com_users');
    JLog::add('$params :' . print_r($params,1), JLog::DEBUG, 'site.user.registration.model.register');
...

The log

 DEBUG 127.0.0.1 site.user.registration.model.register   $params :Joomla\Registry\Registry Object
(
    [data:protected] => stdClass Object
        (
            [allowUserRegistration] => 1
            [new_usertype] => 2
            [guest_usergroup] => 9
            [sendpassword] => 0
            [useractivation] => 0
            [mail_to_admin] => 0
            [captcha] => 
            [frontend_userparams] => 1
            [site_language] => 0
            [change_login_name] => 0
            [reset_count] => 10
            [reset_time] => 1
            [minimum_length] => 4
            [minimum_integers] => 0
            [minimum_symbols] => 0
            [minimum_uppercase] => 0
            [save_history] => 1
            [history_limit] => 5
            [mailSubjectPrefix] => 
            [mailBodySuffix] => 
            [debugUsers] => 1
            [debugGroups] => 1
            [sef_advanced] => 0
            [custom_fields_enable] => 1
        )

    [initialized:protected] => 1
    [separator] => .
)
avatar mixahlos mixahlos - open - 29 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - change - 29 Oct 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Oct 2018
avatar mixahlos mixahlos - change - 29 Oct 2018
The description was changed
avatar mixahlos mixahlos - edited - 29 Oct 2018
avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Removed: J3 Issue
avatar brianteeman brianteeman - unlabeled - 30 Oct 2018
avatar brianteeman brianteeman - unlabeled - 30 Oct 2018
avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar brianteeman
brianteeman - comment - 30 Oct 2018

Were you creating this user in the admin or the frontend?

avatar mixahlos
mixahlos - comment - 30 Oct 2018

In the frontend.
Right now I installed postfix and sendmail in my system and it works fine.

I have a register function in my Controller.

  function register() {
    JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

    $app = JFactory::getApplication();
    $lang = JFactory::getLanguage();
    $lang->load('com_users', JPATH_SITE, $lang->getTag(), true);
    $input = $app->input;

    $currentUri = (string) JUri::getInstance();

    jimport('joomla.application.component.helper');
    $user = new JUser;

    $data = $input->get('jform', array(), 'array');

    require_once JPATH_SITE . '/components/com_users/models/registration.php';
    $regModel = $this->getModel('Registration', 'UsersModel');

    $return = $regModel->register($data);
    $app->setUserState('com_client.registration.data', $data);

    if (!$return) {
      $this->setMessage($regModel->getError(), 'error');
      $this->setRedirect(JRoute::_($currentUri, false));
      return false;
    } else {
      $this->setRedirect(JRoute::_('index.php));
      return true;
    }
  }
avatar joomla-cms-bot joomla-cms-bot - edited - 4 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

@mixahlos can this Issue be closed?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22857.

avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-16 06:10:53
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 16 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Mar 2019
Closed_By joomla-cms-bot franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Mar 2019

closed as no Response; please reopen if needed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22857.

Add a Comment

Login with GitHub to post a comment