Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Richard Ball
  2. Form2Content Lite & Pro
  3. Sunday, 26 July 2020
  4.  Subscribe via email
Linux
Database Type mysql
Database Version 5.6.47
Database Collation utf8_general_ci
PHP Version 7.3.20
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.9.20 Stable [ Amani ] 14-July-2020 15:00 GMT

Form2Content pro_6.17.4
F2C Metadata Generator plugin 1.3.0
plg_form2content_submitmailer_4.1.0

New items are unpublished by default and require moderation.

The article title is created using the F2C Metadata Generator plugin from fields completed by the user:
{$SURNAME|upper}, {$FIRSTNAME|capitalize}

Using submitmailer plugin template:

Username: {username}
Content type: {contentType}
Title: {title}
Category: {category}

this is the email message received:

A new F2C Item has been submitted:

Username: xxx
Content type: memorials
Title: default
Category: PLG_F2CSUBMITMAILER_UNCATEGORIZED

I would like to see if I can adjust this to be more intelligible for the person doing the moderating.
What can I use instead of {title} and {category} which would return the actual title and category?

Thank you,
Richard
Responses (6)
Accepted Answer Pending Moderation
Hi Richard,

I think there's still a bug in the plug-in.
When I open this file: /plugins/system/f2csubmitmailer/f2csubmitmailer.php
It says one line #119: $title = $jForm->getInt('title', '');

This should be: $title = $jForm->getString('title', '');

When the category PLG_F2CSUBMITMAILER_UNCATEGORIZED is returned, that means that there's no category. You get the ugly string, because no translation for this is defined. You can add this to your language file and a translation like 'no category' or 'uncategorized'.

Hope this helps.

best,
Julien
Accepted Answer Pending Moderation
There are two editions of this plugin on your web site - I am using plg_form2content_submitmailer_4.1.0 dated 2018 and not the other which is dated 2014.

I do not find the code you refer to.

Below is the code dealing with title - from that what seems to be happening on my web site is that the last 'else' option is being activated (the default title of my content type title is 'default'), presumably because the title is not being found?

Thanks,
Richard

// Get the title for the form
if(array_key_exists('jform', $_POST) && array_key_exists('title', $_POST['jform']))
{
// Get the title from the request
$title= $_POST['jform']['title'];
}
else
{
if($f2cId)
{
// get the title from the existing article
$query = $db->getQuery(true);
$query->select('title');
$query->from('#__f2c_form');
$query->where('id = ' . (int)$f2cId);

$db->setQuery($query);

$title = $db->loadResult();
}
else
{
// get the default from the Content Type
$title = $contentTypeSettings->get('title_default');
}
}
References
  1. https://www.form2content.com/download/f2c-plugins/download-form2content-core-plugins-f2c-submit-mailer-plugin-4-1-0-for-joomla-3-x-j30
Accepted Answer Pending Moderation
Hi Richard,

Sorry for the confusion about the plug-in version.
I have now tested with the version you are using and the test was successful.

I'm not sure why it is not working on your site.

Could you send me an Akeeba back-up of your site, so I can see if I can find the problem?
You can send it via WeTransfer to julien at opensourcedesign dot nl

Thanks!

best,
Julien
Accepted Answer Pending Moderation
Thank you for the offer - I may do that yet.

But I have now noticed that 'new submissions' are sending an email as I described earlier:

A new F2C Item has been submitted:
Username: xxx
Content type: memorials
Title: default
Category: PLG_F2CSUBMITMAILER_UNCATEGORIZED

but notifications of modifications are coming through as I would wish:

An F2C Item has been updated:
F2C Id: 54
Content type: memorials
Username: xxx - // the username
Title: xxx - // the article title
Category: Memorials

I have therefore copied and pasted, in the plugin, the text from the 'updated' box to the 'submitted' box and wait to see if that has the desired result!

Will let you know.

Richard
Accepted Answer Pending Moderation
Thank you - I have sent the backup to you.

In every case a new submission never provides the title but does provide the username, as:

A new F2C Item has been submitted:

F2C Id: 0
Content type: memorials
Username: XXXxxxx
Title: default
Category: PLG_F2CSUBMITMAILER_UNCATEGORIZED

whereas notifications of amendment may or may not (but usually does) include the username, but always (so far) includes the article title:

An F2C Item has been updated:

F2C Id: 60
Content type: memorials
Username: XXXxxx
Title: VAN DEN BERG, Ida Marie
Category: Memorials

An F2C Item has been updated:

F2C Id: 0
Content type: memorials
Username: PLG_F2CSUBMITMAILER_ANONYMOUS
Title: VAN DEN BERG, Ida Marie
Category: PLG_F2CSUBMITMAILER_UNCATEGORIZED

I hope you will be able to sort it out for me.

Many thanks,
Richard
Accepted Answer Pending Moderation
Hello Richard,

Thank you for the Akeeba back-up.
I know now what is happening:

The title for a new F2C Article is created with the metadata generator like this: {$SURNAME|upper}, {$FIRSTNAME|capitalize}
However, the e-mail plug-in doesn't know this and just grabs the F2C Title field value from the post data, and for a new article this happens to be "default".

I think this can be fixed with some hacking of the e-mail plug-in. When a new article is submitted, you should get the lastname and firstname from the post data and uses those values to construct the title for the e-mail.
The technical field name for first and lastname are t83 and t82 in the post data. Does this make sense?

Best,
Julien
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.