Willkommen, Gast
Angemeldet bleiben:

THEMA:

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242642

  • Autor
  • rambopierce
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 39
  • Dank erhalten: 0
I'm a new user of BreezingForms Pro and have a rookie question. I built my first form to update the user profile information of a registered Joomla user. Upon submitting the form the submit updates the table _facileforms_subrecords. Instead, I would like to update the built-in Joomla table _user_profiles, key 'profile.address1', for the logged-in user, for example.

I am looking for the simplest solution and am confused as to whether this should be after -submit javascript, or after-submit piece, or use Integrator, or Content Builder? All of that is confusing to me.

Also, if the simplest solution is an after-submit piece could you provide a php code snippet to update 'profile.address1', for example? How would I configure an element on a form so that on submit it updates 'profile.address1' in the Joomla _user_profiles table rather than writing to _facileforms_subrecords?

thanks,
Richard

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242675

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10063
  • Karma: 167
  • Dank erhalten: 801
Hi,

your case sounds a classic case for an End Submit piece (just a general example):
// loading ff_getSubmit() into this piece, to use later below
$this->execPieceByName('ff_InitLib');

$db = JFactory::getDbo();

// you might want to do an insert, I am assuming in this example it exists already
$db->setQuery("Update #__user_profiles Set profile_value = " . $db->quote( 
ff_getSubmit("FIELDNAME") ) . " Where profile_key = 'profile.address1' And user_id = " . $db->quote( JFactory::getUser()->get('id') ));

$db->execute();

Replace FIELDNAME with the name of the field (not title) that is supposed to populate the profile value.

Personally, I find end submit pieces better for these cases if I have to control more things alongside the submission.

It would be possible with the Integrator, of course, but I wouldn't let it operate on joomla core tables as they are often interconnected. The integrator is basically a simple solution to integrate data as one-shot data populater without a large amount of wofkflow control.

ContentBuilder is for creating content templates, list views and inserting/updating actual sets of records rather than using it for 3rd party integration.

Hope this helps!

Regards,
Markus

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by TheMuffinMan.

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242689

  • Autor
  • rambopierce
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 39
  • Dank erhalten: 0
Markus,

It helps very much, thank you. I will try out the end submit piece method and get back with you. I had looked at integrator, but the drop-down list presented for the table I selected didn't have the key I wanted to update so I punted. Appears end submit piece is more straight forward to me anyhow. Why and when would you choose to use end submit script over end submit piece?

thanks,
Richard

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242690

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10063
  • Karma: 167
  • Dank erhalten: 801
Hi,

scripts are executed on the client, which in principle allows to alter the behavior.
With pieces (=php) you can make sure this is not going to happen as it is executed on the server-side.

Regards,
Markus

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242697

  • Autor
  • rambopierce
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 39
  • Dank erhalten: 0
I see. I'm embarrassed to ask, but how do you tie the piece to the form?

thanks,
Richard

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Updating built-in Joomla user registration table 3 Monate 2 Wochen her #242699

  • Autor
  • rambopierce
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 39
  • Dank erhalten: 0
Never mind, I haven't had my coffee yet, it's Advanced -> Form Options: More Options -> Submit pieces.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by rambopierce.
  • Seite:
  • 1
  • 2
Moderatoren: ForumSupport
Ladezeit der Seite: 0.059 Sekunden

Angebot

Sommer Special! Alle Mitgliedschaften zum Sonderpreis!

Prio Support, alle Extensions und alle Templates in einem Paket.

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Pro-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!