• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

  • Update & Changlog URL Fixer

    At the present time the update site URL for Fabrik is incorrect in all installations up to and including 4.1. This will be corrected in 4.2, however, if you wish to update Fabrik via the J! Updater you can download and install this plugin.

    This file is installed just like any other extension through the J! Extension Installation panel. It will not however actually install anything. Its sole purpose is to fix the Update Site and Changlog URL's. Once done it will simply exit.

    As always, we recommend you perform a site backup priot to installation.

listcsv plugin generates fatal error

EricWebsite

Member
Hi,
When importing users into a list with import from csv I neeeded to generate Joomla users as well, so I installed the listcsv plugin in the list.
In the first test, this generated an error:
"Fatal error: Array and string offset access syntax with curly braces is no longer supported in ....../plugins/fabrik_list/listcsv/scripts/csv_import_user_class.php on line 99".
Line 99 reads:
Code:
$string = $chars{rand(0, $chars_length)};
Replacing the curly brackets with '(' and ')' will probably do the trick, but the generated password could be a lot better.

I came up with:
Code:
    private function rand_str()
    {
        // leave out letter o and zero, 1 (one) an l (letter), etc to avoid confusion
        $charslower = "abcdefghijkmnpqrstuvwxyz";
        $charsupper = "ABCDEFGHIJKMNPQRSTUVWXYZ";
        $charsnumber = "23456789";
        $charsspec = "!@#$%&*(){}_+";
        // at least 1 lowercase, 1 uppercase, 1 number, 1 special character
        $chars = substr(str_shuffle($charslower),0,1);
        $chars .= substr(str_shuffle($charsupper),0,1);
        $chars .= substr(str_shuffle($charsnumber),0,1);
        $chars .= substr(str_shuffle($charsspec),0,1);
        // add 8 more from a mix of all
        $chars .= substr(str_shuffle($charslower . $charsupper . $charsnumber . $charsspec),0,8);
        $password = str_shuffle($chars);
        return $password;
    }

A second point: I think it would be a lot easier if the user can set the parameters directly in the plugin (like in juser), rather than have to do that in a copy of create_client_user.php.
Please let me have your thoughts!
 
$csv_user->userid_element = 'changethis_userid';
Maybe you took this literally? It should be 'changethis___userid'; (3_)
 
This is confusing. In csv_import_user_class.php Hugh wrote: 'There is nothing in this file that needs changing.'
And 'DO NOT set these class variables here. Instead, set them in your copy of create_client_user.php'

Nevertheless on line 39 and further, it reads:
Code:
    /*
     * REQUIRED
     *
     * The full Fabrik element names for the username, email, name and J! userid.
     * The plugin will write the newly created J! userid to the userid element.
     * These four are REQUIRED and the code will fail if they are missing or wrong.
     *
     * NOTE - if $name_element is blank, use optional first and last name elements to create full name
     */
    public $username_element = 'changethis___username';
    public $email_element = 'changethis___email';
    public $name_element = 'changethis___name';
    public $userid_element = 'changethis_userid';
Indeed with one underscore in 'changethis_userid'.

If you don't set these 4 in csv_import_user_class.php (as I did first), or do set them seems to make no difference.
I did set them in my copy of create_client_user.php (with the correct 3 underscores in userid).
 
A bit confusing, yes (but it says "nothing needs changing", so you can do what you want if you are using a copy (and include this copy in your copy of create_client...)

I think in csv_import... these "required" public vars are only for initialisation, I don't know why they are not set to a simple "" (maybe it was only a copy/paste from one file to the other, I assume the example file(s) were split at some point ... history mysteries...)

The "optional" ones are setting default values.

So obviously the examples can be improved...
 
No email is being sent to the nimported user either
I can't see where this should be done.

What do you get as system messages?
What do you get in the log?
 
I think in csv_import... these "required" public vars are only for initialisation
Seems like a leftover, I don't see if any of these declared public $..... variables are used anywhere???

(maybe it was only a copy/paste from one file to the other, I assume the example file(s) were split at some point ... history mysteries...)
Yes, it looks like it.

After the import I get a success message.

In the Fabrik log I find nothing relevant. Will: jimport('joomla.log.log'); as in the script still work?

No email is being sent to the nimported user either
I can't see where this should be done.
If a create a user from the list then joomla sends the mail. The form has the juser plugin installed, set to:

Bypass activation; yes
Bypass registration: yes
Account details email no (but according to the help popup: if yes will NOT send the standard Joomla welcome mail
Bypass all email: no

So I hoped a mail would be sent.
 
I'm testing. I didn't find the reason for the missing userid yet but it was sending a J! mail for the new created user.
Fixes: Only changed the old {} to [] in csv_import
1715182717881.png


So mailing is doing. The script is setting nothing extra, so it may be your J! settings.
 
I'm surprised! Did you (as I am trying to do) use the 2 step approach: use a copy of create_client_user.php set in the plugin to call the updated csv_import_user_class.php?
 
Back
Top