Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Warning: substr() expects at most 3 parameters, 4 given

10 years 8 months ago
  • Alex's Avatar
    Topic Author
  • Alex
  • Offline
  • Fresh Boarder
  • Posts: 30
  • Thank you received: 2
Licenses:
JomSocial Active

When viewing the Member Profiles, the date field is causing multiple error messages. This is repeatable in the back end:
Components | Jomsocial | Dashboard | Members | (select a member profile) | Basic Information and in the Birthdate field are multiple instances of this error:

Warning: substr() expects at most 3 parameters, 4 given in /home/XXXXXXXX/public_html/components/com_community/libraries/fields/date.php on line 185

In the Front End, the error is found by Logging in the going to Community | Profile | Edit Profile and there are multiple errors in the Birthdate field:

Warning: substr() expects at most 3 parameters, 4 given in /home/XXXXXXXX/public_html/components/com_community/libraries/fields/date.php on line 185

The following user(s) said Thank You: Stix
10 years 8 months ago
Licenses:
JomSocial Expired GURU Expired Publisher Expired AdAgency Expired iSEO Expired Socialize Expired

Hi Alex,
It was a valid bug and already fixed.
Though the fix will come up with our next version but I have updated at your site.
Here the fix code as

$monthNames = array_map(function ($item) {
            return "'" . $item . "'";
        }, $months);
        $monthNamesShort = array_map(function ($item) {
            return "'" . substr($item, 0, 3, 'UTF-8') . "'";
        }, $months);
        $dayNames = array_map(function ($item) {
            return "'" . $item . "'";
        }, $days);
        $dayNamesShort = array_map(function ($item) {
            return "'" . substr($item, 0, 3, 'UTF-8') . "'";
        }, $days);
        $dayNamesMin = array_map(function ($item) {
            return "'" . substr($item, 0, 2, 'UTF-8') . "'";
        }, $days);
replaced by
$monthNames = array_map(function ($item) {
            return "'" . $item . "'";
        }, $months);
        $monthNamesShort = array_map(function ($item) {
            return "'" . mb_substr($item, 0, 3, 'UTF-8') . "'";
        }, $months);
        $dayNames = array_map(function ($item) {
            return "'" . $item . "'";
        }, $days);
        $dayNamesShort = array_map(function ($item) {
            return "'" . mb_substr($item, 0, 3, 'UTF-8') . "'";
        }, $days);
        $dayNamesMin = array_map(function ($item) {
            return "'" . mb_substr($item, 0, 2, 'UTF-8') . "'";
        }, $days);
Please check.
Thanks

The following user(s) said Thank You: Alex
10 years 8 months ago
  • Alex's Avatar
    Topic Author
  • Alex
  • Offline
  • Fresh Boarder
  • Posts: 30
  • Thank you received: 2
Licenses:
JomSocial Active

It is working properly, thank you!

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW