Unable to display user form for edit

kjalderton

New Member
I have been trying to use the following and all I am getting is a new form

{fabrik view=form id=5 userkey=clients rowid=[$my->id]}

If I remove [$my->id] and replace with a number my form appears correctly but trying to this gives a form for entering data.
has $my->id been superseded?

Many thanks for a shining light
 
I have tried getting around this with using a menu but filling in the menu's 'Fabrik Form Options' with '-1' as it instructs for logged in user's detail. The form appears ready to be filled in and saved.
In the under laying field, 'Row Id' I have filled in the 'Name id' as it says. Still the same.
Am I missing something totally obvious?
 
Not sure what you want to do.

"usekey" (not userkey) + rowid=-1 is for displaying a record "belonging" to the logged-in user (so no need to use $my->id but this is working also)
Your list/form needs an element for holding the userID (usually a user element), in your example this would be your 'clients' element.

If you are calling the form with

{fabrik view=form id=5 usekey=clients rowid=-1} (or with the form menu settings 'Row id'=-1 and 'Key name'=clients )
it's creating a new record if there's not already one belonging to the user or it's displaying the exiting record.

Both is working.
 
Thank you troester for your help.

"usekey" (not userkey) my mistake and I thought that was it but alas it is not.

{fabrik view=form id=5 usekey=clients rowid=-1} form displays but no data.

{fabrik view=details id=5 usekey=clients_id rowid=-2} displays a random user

{fabrik view=details id=5 usekey=clients_id rowid=10} displays the user with id=10.

I am assuming that somewhere I am not picking up the logged in user. Is there away of checking if the user is logged with fabrik ID number that you know of?
Thank you
 
It's the Joomla userID number.

usekey=xy must be the column name (element short name) of your element which is storing the userID when the record is saved.
So in your case clients? clients_id?
Do you have such an element at all?

Usually a (hidden) "user" element which fetches the userID of the logged-in user automatically and stores it depending on the settings: default is "Update on edit"=no (so the userID of the user creating the record).
http://fabrikar.com/forums/index.php?wiki/user-element/
 
Perhaps this time
 

Attachments

  • form-detais.png
    form-detais.png
    38.7 KB · Views: 39
  • Fabrik edit form Clients .png
    Fabrik edit form Clients .png
    61.2 KB · Views: 35
Which element type is clients_id?
In this case (used in a juser form plugin) it should be a field or a dbjoin to #_users (no "user" element).

{fabrik view=form id=5 usekey=clients_id rowid=-1}
should do then.
 
The penny has finally dropped. Thank you so much for your assistance. I works now. The only problem I get now if some one registers it throws an error:
"Class "Date" not found" on checking the logs I have the following:
CRITICAL error Uncaught Throwable of type Error thrown with message "Class "Date" not found". Stack trace: #0 [ROOT]/components/com_fabrik/models/pluginmanager.php(698): PlgFabrik_FormLog->onAfterProcess()

Any idea what I have done wrong again?
 
Which exact Fabrik and php version?

Which plugins did you add to your form (beside juser), the log plugin?

If you have added the log plugin:
Is it ok with log plugin disabled?
Which exact plugin settings?

BTW: For testing/debugging you can enable J!'s "Debug System" which will show you the error stack directly.
 
Your spot on again. I was trying the log plugin and left it loading. Still loading now. Once deleted everything is good.
I assume the log plugin is WIP.
Many, many thanks again
 
Seems you are the first one who used it in F4.
In plugins\fabrik_form\log\log.php
line 211, 469 and 646 remove \, so

$date = new Date();
 
Last edited:
Very good. Corrected those but we are still loading with this error:

error Uncaught Throwable of type Error thrown with message "Call to a member function setQuery() on null". Stack trace: #0 [ROOT]/plugins/fabrik_form/log/log.php(48): PlgFabrik_FormLog->install()
#1 [ROOT]/administrator/components/com_fabrik/models/plugin.php(52): PlgFabrik_FormLog->onRenderAdminSettings()
#2 [ROOT]/administrator/components/com_fabrik/views/plugin/view.raw.php(50): FabrikAdminModelPlugin->render()
#3 [ROOT]/libraries/src/MVC/Controller/BaseController.php(645): FabrikAdminViewPlugin->display()
#4 [ROOT]/administrator/components/com_fabrik/controller.php(42): Joomla\CMS\MVC\Controller\BaseController->display()
#5 [ROOT]/libraries/src/MVC/Controller/BaseController.php(678): FabrikAdminController->display()
#6 [ROOT]/administrator/components/com_fabrik/fabrik.php(104): Joomla\CMS\MVC\Controller\BaseController->execute()
#7 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(71): require_once('...')
#8 [ROOT]/libraries/src/Dispatcher/LegacyComponentDispatcher.php(73): Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()
#9 [ROOT]/libraries/src/Component/ComponentHelper.php(361): Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()
#10 [ROOT]/libraries/src/Application/AdministratorApplication.php(143): Joomla\CMS\Component\ComponentHelper::renderComponent()
#11 [ROOT]/libraries/src/Application/AdministratorApplication.php(186): Joomla\CMS\Application\AdministratorApplication->dispatch()
#12 [ROOT]/libraries/src/Application/CMSApplication.php(293): Joomla\CMS\Application\AdministratorApplication->doExecute()
#13 [ROOT]/administrator/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute()
#14 [ROOT]/administrator/index.php(32): require_once('...')
#15 {main}
 
I can't replicate.
Maybe the original error left something screwed up.

Can you
- delete the log plugin in your form
- directly in your database delete the #__fabrik_change_log, ..._fields, ..._types tables
- add the log plugin again to your form
 
That is strange, I do not have #_fabrik_change_log
I do have #_fabrik_log
 

Attachments

  • database.png
    database.png
    18.7 KB · Views: 28
Which exact Fabrik 4 are you running, Epsilon? A new installation or some J!3/F3 upgrade?
Which PHP version?

The 3 ...change_log... tables should be there as soon as you have added the plugin to a form.

"Call to a member function setQuery() on null....PlgFabrik_FormLog->install()"
This is where they are created/updated and the query really can't be NULL.

Can you double check that you didn't introduce some typo while adding the fixes in log.php
 
The version of Fabrk4 is delta. php 8.1
I can not see if I have altered more than the slashes on $date. A copy is attached.
 
Sorry here they are
 

Attachments

  • everything.log.txt
    1.7 KB · Views: 30
  • log.php.txt
    22 KB · Views: 28
  • plugins.png
    plugins.png
    33.2 KB · Views: 30
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top