[SOLVED] Form PHP plugin: function to read and store data between two tables

Ah, you are doing this as an AJAX submission?

It's easier to debug these things if you do it from a simple component link, no AJAX. Then you can do that "var_dump(); exit;" thing, and see the output in the browser.

-- hugh
 
I have unchecked aiax validation on module processing tab, but aiax popup is still loading. Is there another place where to disable aiax or may I have to check for direct component link? I have also installed J!dump and change var_dump to dump, but J!dump popup window say that there is no variable to dump.
 
No way! I have tried to open editing page from link and not from popup and then submit the form, but still it shows no variables to dump.
 
In a module (or content plugin) it will always submit with AJAX. So test it from a normal menu item (or just build the URL yourself, ?index.php?option=com_fabrik&view=form&formid=X).

If that var_dump() line with the "exit' is uncommented, the all processing should stop there, and you just get a blank page with the dump output.

What plugin hook are you using (the dropdwn where you tell it when to run your code)? onBeforeProcess?

-- hugh
 
1- Form tested with a new menu item, but on form submission a spinner appeared, so I think it is still aiax.
2- var_dump() uncommented (it was never been commented). On form submission, processing ended with the details page and no blank page appeared.
3- same results using onAfterProcess (my default choice) and OnBeforeProcess.
 
I've gone as far as I can with this in Community support. If you want to take out a standard sub for a month, I'll log in to your site and fix it for you.

-- hugh
 
In the end, after many try&error I managed with this statement:
Code:
$galleryId = (int)'{caduti___ID_JOOMGALLERY_raw}';
if ($galleryId <> 0) {
  $myDb = JFactory::getDbo();
  $myQuery = <<< EOT
  UPDATE unirrit_caduti.caduti
    SET foto_ok= CONCAT("/images/joomgallery/originals/deceduti_sul_fronte_russo_3/",
    (SELECT imgfilename
        FROM unirrit_jos2.unr_joomgallery
        where id=$galleryId)) WHERE
    id_joomgallery = $galleryId
EOT;
   $myDb->setQuery($myQuery);
   $myDb->execute();
}
I've found that var_dump() issue was related to a syntax error. When I managed with var_dump results I've noticed that placeholder was passed as label rather than as value. Maybe this was due to plugin hook, but now this work as expected.
I know that you have done a lot of work for me, and that you help me to understand how this works, so I really want to thank you, Hugh.
 
I'm doing this as a volunteer, so I'm trying to keep my expenses as low as possible, but next time I will need a help I will go for a subscription, I promise! :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top