Uncaught error in lang.php - WordPress Restricted Access

cboezio 14 Mar, 2023
When trying to access ChronoForms 7 from the Wordpress backend, I get a page with minimal formatting and displaying the following error at the end:

Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /…/wordpress/wp-content/plugins/chronoforms/chronog3/libs/lang.php:25


The line in question is within a method block that has an underscore as identifier but no name. Is that normal? I can't find where to download older versions of CF for WP from to compare the source code. This ChronoForms plugin worked properly before, I think it stopped working after a Wordpress update. How can I make it work properly again?

ChronoForms version 7.0.9, Wordpress version 6.1.1, PHP version 8.0

Please add a search function to the forum to avoid repetitive posts of similar problems and to allow users to easily and quickly find posts. There 1600+ pages…

Thank you for any assistance.
Max_admin 20 Apr, 2023
Does the error show any more info ? like the caller of this function ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gatsman 24 Apr, 2023
Hello Max, i also get the same error whenever the PHP version is set higher or equal to version 8.0
This is the full error that it displays:

Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/lang.php:25 Stack trace: #0 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/lang.php(25): vsprintf('Select image of...', '%s') #1 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/gcloader.php(50): G3\L\Lang::_('Select image of...', '%s', false) #2 /home/chronodemo/public_html/wp-content/plugins/chronoforms/admin/chronoforms/views/field_secicon/field_secicon.php(16): rl3('Select image of...', '%s') #3 /home/chronodemo/public_html/wp-content/plugins/chronoforms/admin/chronoforms/themes/default/views/connections/draggables2.php(18): require('/home/chronodemo...') #4 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(261): include('/home/chronodemo...') #5 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(333): G3\L\View->_contents('/home/chronodemo...', Array) #6 /home/chronodemo/public_html/wp-content/plugins/chronoforms/admin/chronoforms/themes/default/views/connections/dragndrop_forms.php(68): G3\L\View->view('/home/chronodemo...') #7 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(261): include('/home/chronodemo...') #8 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(333): G3\L\View->_contents('/home/chronodemo...', Array) #9 /home/chronodemo/public_html/wp-content/plugins/chronoforms/admin/chronoforms/themes/default/views/connections/edit.php(115): G3\L\View->view('/home/chronodemo...') #10 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(261): include('/home/chronodemo...') #11 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/view.php(217): G3\L\View->_contents('/home/chronodemo...') #12 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/app.php(248): G3\L\View->renderView('edit') #13 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/app.php(78): G3\L\App->dispatch(true) #14 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/app_loader.php(61): G3\L\App::call('admin', 'chronoforms', 'connections', 'edit', Array) #15 /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronoforms.php(203): G3\L\AppLoader->__construct(Array) #16 /home/chronodemo/public_html/wp-includes/class-wp-hook.php(308): Chronoforms->cf7_admin('') #17 /home/chronodemo/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #18 /home/chronodemo/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #19 /home/chronodemo/public_html/wp-admin/admin.php(175): do_action('admin_init') #20 /home/chronodemo/public_html/wp-admin/index.php(10): require_once('/home/chronodemo...') #21 {main} thrown in /home/chronodemo/public_html/wp-content/plugins/chronoforms/chronog3/libs/lang.php on line 25



*Let me know if it will help you to get access to an environment that will create this error i will be more than happy to setup a wordpress with chronoforms 7 and give you full access to have a look.
Max_admin 24 Apr, 2023
Answer
it should be fixed now in the WP plugins repo, so if you download from there and install over yours then it will be fixed
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gatsman 24 Apr, 2023
1 Likes
I just updated the plugin and now it does not show the error but the form will not load to edit.
Uncaught error in lang.php - WordPress Restricted Access image 1
Max_admin 24 Apr, 2023
that means another error, can you right click and choose "view source" then find the error at the end of the source code ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gatsman 24 Apr, 2023
1 Likes
No error anywhere in the source code it ends like this:

<div class="ui message yellow inverted toast" id="pageDelete">
<div class="content">
<div class="ui header red">Warning</div>
Do you really want to delete this page and all included Units? </div>
<div class="left basic actions">
<button class="ui positive red button">Yes</button>
<button class="ui negative button">No</button>
</div>
<br />
Please note that, if your form has one page only then some features may not work correctly! </div>

<div class="three wide column scrollableBox hidden">
<div class="ui fluid container unitsContainer2" id="unitsContainer2">
</div>
</div>

<div class="column">
<div class="ui fluid container unitsContainer" id="unitsContainer" style="z-index:1010;">
Restricted access

cboezio 16 May, 2023
The screenshot posted by @Gatsman is similar to what I see. The backend page for editing a particular form has html only, no CSS and no JavaScript. Furthermore the html code is truncated, the last few <div>-elements are not closed and the code ends with "Restricted Access". I run WP 6.2 now and the error persists after deleting and re-installing the plugin.
Gatsman 16 May, 2023
1 Likes
Good to know i am not the only one with this.
Max when you can find some time please give it another look we would greatly appreciate it.
Max_admin 21 May, 2023
Does the error occur when you try to create a new "Contact" form ? or a Connectivity app ?

That maybe a memory limit error, it looks like WP 6 and up is using more memory, and if your form is large then that may be causing the issue.

That's what I could find as a reason for the "Restricted access" issue.

What is your WP site PHP memory limit ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gatsman 21 May, 2023
Hello Max,
This happens when you try to edit any existing form and also when you try to create any new form (Contact Form, Advanced Form or Connectivity App)
Default PHP memory limit 128M but i have increased it to PHP memory limit 2048M but nothing changed.

Uncaught error in lang.php - WordPress Restricted Access image 2
Max_admin 23 May, 2023
Could you please check the server error logs ? there should be an error behind the "Restricted access" message
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gatsman 31 May, 2023
Hi Max sorry for the delay but i was tied up with some other work.
Please take notice that this Restricted access issue is happening on every php version not only >8.0 and there are no errors logged on the error logs of the server because the code isn't producing any error.

It looks like the "Restricted access" message is generated by the script at "./wp-content/plugins/chronoforms/admin/chronoforms/views/field_secicon/field_secicon.php".
In the contents of that file, the PHP is being instructed to "die" and output "Restricted access" if there isn't a named constant "_JEXEC" already defined.
--
defined('_JEXEC') or die('Restricted access');
--
"_JEXEC" is a constant that is typically defined in the "index.php" file at the root of the Joomla! instance and is used to mark a secure entry point into Joomla. The defined or die check makes sure that "_JEXEC" has been defined in the pathway to get to the file.
But since we are using WordPress, there will not be a "_JEXEC" already defined.
So this is most probably the case of the issue, if i comment that php line the form edit will load again but please give it a look yourself and advise.
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger