[Beta] Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated #1037
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1037
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Expected result
Actual result
System information (as much as possible)
Additional comments
I thought I fixed this already... I will take another look. Thanks!
Okay lets see... the method being called here is the shorten method from the StringHelper class, found here:
Can you check if your string helper class is in sync? not only in your file system but also in the powers database area? Since I found if you compile a Joomla 3 component and install it will build the string helper class from what you have in your database and overwrite the string helper class (on installing this component locally)... not sure if this quarks is ideal, and I am trying to resolve it.
How to update the StringHelper class in your install (DB) of JCB... select the class in the list view and at the top click '[Reset]` this will sync your version of the StringHelper class (in your database) with the current up-to-date version from the global repository.
I updated this global repository with all the changes we made. This global repo will normally stay in step with all the changes we make. This global repos is the place from which JCB will fetch all the classes and code it needs when it builds features for your component that was not shipped with the ZIP package.
Long story short.. you can clone this repos and point your instance of JCB at your own version... which will allow an override effect (but that is a topic for another day).
After all that... this is the fix:
It use to be the following (which has the null):
Please check if it resolves your issue.
I don't know, if I got everything right.
I did the following:
The code in /libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php is the following:
$words = preg_split('/([\s\n\r]+)/', (string) $string, null, PREG_SPLIT_DELIM_CAPTURE);
I still get the depreated message.
Nope this should not happen... please delete one.
Change the code:
TO THIS CODE:
Note the
-1
value it must not be null...You must change the code in the database, and in the local file found at:
Ok, now it works. Thanks.