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
Form2Content Forum
Questions and answers for Form2Content, a Joomla CCK.
- Richard Ball
- Form2Content Lite & Pro
- Sunday, 26 July 2020
- Subscribe via email
Accepted Answer
Accepted Answer
Pending Moderation
Hello Richard,
In this case the fields you need are not part of the jform array, you can get their values directly like this:
$surname = $_POST['t82'];
$givenNames = $_POST['t83'];
You can them combine these fields in the title field like this:
$title = $givenNames . ' ' . $surname;
That should fill the title field with correct values.
You can use this piece of code instead the block of code that starts on line #125:
if(array_key_exists('jform', $_POST) && array_key_exists('title', $_POST['jform']))
Hope this helps!
best,
Julien
In this case the fields you need are not part of the jform array, you can get their values directly like this:
$surname = $_POST['t82'];
$givenNames = $_POST['t83'];
You can them combine these fields in the title field like this:
$title = $givenNames . ' ' . $surname;
That should fill the title field with correct values.
You can use this piece of code instead the block of code that starts on line #125:
if(array_key_exists('jform', $_POST) && array_key_exists('title', $_POST['jform']))
Hope this helps!
best,
Julien
- more than a month ago
- Form2Content Lite & Pro
- # Permalink
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
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
- more than a month ago
- Form2Content Lite & Pro
- # 1
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');
}
}
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');
}
}
- more than a month ago
- Form2Content Lite & Pro
- # 2
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
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
- more than a month ago
- Form2Content Lite & Pro
- # 3
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
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
- more than a month ago
- Form2Content Lite & Pro
- # 4
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
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
- more than a month ago
- Form2Content Lite & Pro
- # 5
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
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
- more than a month ago
- Form2Content Lite & Pro
- # 6
Accepted Answer
Pending Moderation
Hello Julien,
Thank you for looking at this and for your explanation, which I understand..
Unfortunately, though I can write scripts with Perl and manage PHP with simple things, Joomla programming is a closed book to me and I have no idea where to include or substitute your t82 and t83..
I assume that you mean I need to hack the plugin itself - plgSystemF2cSubmitMailer - not the input to the plugin in the joomla backend?
in the plugin I assume this is where I would need to make alterations:
line 124 - // 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');
}
}
but I don't know how to use t83 t82 in place of
$title= $_POST['jform']['title'];
or $query->select('title');
would I simply replace 'title' as in
$title= $_POST['jform']['t83' 't82'];
or can you point me to appropriate help?
I have googled but have not found anything.
Many thanks for your help,
Richard
Thank you for looking at this and for your explanation, which I understand..
Unfortunately, though I can write scripts with Perl and manage PHP with simple things, Joomla programming is a closed book to me and I have no idea where to include or substitute your t82 and t83..
I assume that you mean I need to hack the plugin itself - plgSystemF2cSubmitMailer - not the input to the plugin in the joomla backend?
in the plugin I assume this is where I would need to make alterations:
line 124 - // 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');
}
}
but I don't know how to use t83 t82 in place of
$title= $_POST['jform']['title'];
or $query->select('title');
would I simply replace 'title' as in
$title= $_POST['jform']['t83' 't82'];
or can you point me to appropriate help?
I have googled but have not found anything.
Many thanks for your help,
Richard
- more than a month ago
- Form2Content Lite & Pro
- # 7
Accepted Answer
Pending Moderation
Hello Julien,
Some little while ago you wrote:
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?
My answer is 'No, to me it does not make sense' - can someone in the know please point me in the right direction for instruction on how to do this?
Thank you,
Richard
Some little while ago you wrote:
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?
My answer is 'No, to me it does not make sense' - can someone in the know please point me in the right direction for instruction on how to do this?
Thank you,
Richard
- more than a month ago
- Form2Content Lite & Pro
- # 8
Accepted Answer
Pending Moderation
Great! Many thanks - I'll give that a go and let you know how it goes.
Richard
Richard

- more than a month ago
- Form2Content Lite & Pro
- # 9
Accepted Answer
Pending Moderation
That works just fine!
Thank you very much for your help.
Richard
Thank you very much for your help.
Richard
- more than a month ago
- Form2Content Lite & Pro
- # 10
- Page :
- 1
There are no replies made for this post yet.
However, you are not allowed to reply to this post.
However, you are not allowed to reply to this post.
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »