• Fabrik4.5.3 for J!5.3.0 and J!4.2+is out

    You must update from Fabrik4.5.1 if you are running Joomla!5.3.0

    See Announcements

Problem on Multi Lingual websites to load "Element"-min.js.map

wuschel_lux

Member
Good morning,
after updating to Fabrik 4.5, running on Joomla 5.2.3 on Apache Web Server, with PHP 8.2.27 and 10.5.26 MariaDB, I found an issue that my form is not loading "Element"-min.js.map files, due to a URL missmatch.

E.g. for one Element: this Java Console error exists for each element in the form:
Failed to load resource: the server responded with a status of 404 ()
/fr/plugins/fabrik_element/internalid/internalid-min.js.map

-> path on the server to the file is without the /fr/ or /en/, ....

after a long waiting time, the page results in en error 504.

Was a change made to 4.5 that could impact multilingual sites, in the previous version the issue was not detected.
Due to a longer period version 4.5 is running, I could not go back to the backup file, because a lot of new registrations was done in the system.
 
Indeed, with SEF off it's working fine,
but my site cannot work without SEF enabled, a lot of custom code based on URLs.
 
As a workaround: does it help if you set FabrikDebug= DebugJS in Fabrik options?

I have a multilang site with SEF which doesn't show an issue.

But I can remember other SEF routing issues which were depending on server types and/or browsers.

I'll leave it to @achartier to dig into it.
 
Turning on Fabrik DebugJS should solve this for now. I am at a loss to determine why your browser cannot find the map file, it is in the same location as the js file. Is this happening to all your users? Is this only happening when you have your browsers developer window open? Have you tried other browsers? Did you clear your browser cache?

Another option for you is to go into the media/com_fabrik/js/dist folder and delete the existing map files. They are only needed when debugging anyway. Although they will come back when you update Fabrik.
 
changed FabrikDebug= DebugJS.
-> console errors gone
-> still runns in an 504 time-out

does it help if you would have access to the site?
 
Browser cache deleted..

Safari: the issue occurs, when logged with Super User and also as guest. -> error 504
Not only in developer mode, also "classic" browsing

Google Chrome: took a bit longer but no error 504 instead following message
[EDIT]: after a new cache delete -> Error 504

Message after submission:
An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval of plugin condition: Undefined array key "inscription_event___status_raw"
URL request:

Firefox: quicker then chrome and same message...
 
Another option for you is to go into the media/com_fabrik/js/dist folder and delete the existing map files. They are only needed when debugging anyway. Although they will come back when you update Fabrik.
combination with deleting and FabrikDebug= DebugJS seems now to workaround the issue.
But not 100% stable for the moment, but realy better quote than before.
 
You need to figure out what is wrong with the plugin condition php code and why it cannot find that element.
 
that's strange, the URL https://domain.com/fr/inscription-event?inscription_event___event_raw=481 only gives the value 481 to the databasejoin field in the form as raw where it maps to the activities DB and returns the "activity name" as label ( concat label: {thistable}.activity_{shortlang} ) with a WHERE condition in the tab "data - where":
WHERE
(
status LIKE "%online%"
AND type = "xy"
)
The field proper returns the requested label.
Any chance you put an eye on?
 
I tried to replicate with an other multilang site but can't see an issue with js.map files.

Is the plugin condition related or a new topic?
I don't get your setup at the moment.
 
it's related.
To explain it's a self written module with a list of activities coming from a database.
When you click on the button the link to the form with a predefined eventID is set, that in the dropdown element the activity is already chosen.
The dropdown element has e WHERE condition that only "online" events are shown.
I assume the error comes from this part?

e.g. https://activites.steinfort.lu/en/register-events?inscription_event___event_raw=481

An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval of plugin condition: Undefined array key "inscription_event___status_raw"
 
I did a fake inscription, you may delete it, all filled with 'b'.

Is the inscription working in principle? So the entry is made, users get their emails etc?
I think the message will be gone if you set Allow Fabrik Debug to NO (but you need it because of the js.map issue?)

Anyway:
It's complaining about the element inscription_event___status not inscription_event___event.

So I don't think it's related to you dbjoin.

Looking at the Fabrik code it may be related to some default eval.

Do you have an eval using inscription_event___status?

Is inscription_event___status published, or does it have access restrictions ( e.g. not visible to guests, so not "existing" at the time this eval code is running)?
 
thanks for the testing.
and yes mails arrived and entry in DB, so the process is good. And yes i need actually the j.map workaround.

My fault I see it's status:
The status is only visible and editable for "Staff" approving the registration.

There is a form php plugin, updating on "End of form submission" the field status in DB with this code:

Code:
use Joomla\CMS\Factory;

// store variable to show in mail
  $formModel->updateFormData('***table***___status', 'inscrit', true);

// real change on DB
  $db = Factory::getContainer()->get('DatabaseDriver');
  $query = $db->createQuery(true);
  $query->update($db->quoteName('***table***'));
  $query->set($db->quoteName('status') . " = 'inscrit'");
  $query->where($db->quoteName('id') . " = :rid");
  $query->bind(':rid', $regID );
  $db->setQuery($query);
  $result = $db->execute();

or ist there a better way to do it?

Eval is not active on status field.
 
Last edited:
just for my understanding, even if it produces the error but how can I get the STATUS (not public element) value to send in E-Mails?
Not that I break this chain for customer information.
And the form e-mail plugin is populated and send before of End of Form Submission?

EDIT: just tested commenting line out, same error message

Here a code snippet in the form email plugin for the condition, not that this could cause the issue:
PHP:
return  $origData["inscription_event___status_raw"] !== 'confirmed'
&& '{inscription_event___status_raw}' === 'confirmed'
&& '{inscription_event___language_raw}' === 'fr';
 
Last edited:
If record is saved=the email is sent by a "Staff" member the status is accessible (I assume it's somewhere in the data also in case of non-staff).
https://fabrikar.com/forums/index.php?wiki/php-form-plugin/#accessing-form-data-8203

e.g.
$formModel->formData // onBeforeStore: use full element names 'table___element'

//for onAfterProcess - use short element names: 'element' - no table name (has issues with joined tables with identical column names (Jan. 2015)

onBeforeCalculation, onAfterProcess

$data['table___element']

I think the best tip here is
https://fabrikar.com/forums/index.php?wiki/php-form-plugin/#debugging-8203
to see what you get where.

email is run also as onAfterProcess, I think you can't rely on a specific order.
But it doesn't matter, email is using the form data, not pulling anything from the database.
 
Back
Top