Hi guys,
since upgrading to J2.5, my previously working forms exibit a strange outcome. The submitted information which creates an article is being displayed twice (i.e the artcile is shown twice). There is however, only one entry in the DB (j25_content table) and only one entry in the article manager.
The URL's below demonstrate the problem.
http://www.wphcfc.net.au
https://www.wphcfc.net.au/index.php/headlions/unpublished-headlions-articles
The above URL needs a login which can be supplied if needed.
The form in question is attached. I have 2 others behaving the same way (simiar code)
This issue was not present under previous joomla versions (1.5) and the last verion of CF for J1.5 and the code in the attached form worked really well.
Could I trouble you to look at this please.
Thanks
-Anthony
				
				
				
			since upgrading to J2.5, my previously working forms exibit a strange outcome. The submitted information which creates an article is being displayed twice (i.e the artcile is shown twice). There is however, only one entry in the DB (j25_content table) and only one entry in the article manager.
The URL's below demonstrate the problem.
http://www.wphcfc.net.au
https://www.wphcfc.net.au/index.php/headlions/unpublished-headlions-articles
The above URL needs a login which can be supplied if needed.
The form in question is attached. I have 2 others behaving the same way (simiar code)
This issue was not present under previous joomla versions (1.5) and the last verion of CF for J1.5 and the code in the attached form worked really well.
Could I trouble you to look at this please.
Thanks
-Anthony
					Hi Anthony,
I'm not sure what's in the Zip file but it doesn't want to restore into CFv4. And, of course, I can't see the form.
Bob
				
				
				
			I'm not sure what's in the Zip file but it doesn't want to restore into CFv4. And, of course, I can't see the form.
Bob
					Hi Bob,
Not sure why the zip is not working. I have attached the native backup (just with a txt extension)
Pls advise if you have an trouble opening this.
Thanks
Anthony
				
				
				
			Not sure why the zip is not working. I have attached the native backup (just with a txt extension)
Pls advise if you have an trouble opening this.
Thanks
Anthony
					Hi Bob,
An update on this.
I created a new form via the easy form mechansim. no custom code. completly vanila. form had a textbox for the field "title" and a text area for the field "fulltext". The form saved the data correctly to j25_content as expected. There is only one entry in the d/b but...
when published, the article itself is displayed twice. (both title and content). There is only one version when viewed via article manager in the backend. Also, I notice CF is adding a "readmore" at the top of the article (i.e. before the copntent that was inputted via the form). This trait has been around since J1.5 versions not sure why.
also, Joomla version is 2.5.7. CF version is latest that can be downlaoded.
				
				
				
			An update on this.
I created a new form via the easy form mechansim. no custom code. completly vanila. form had a textbox for the field "title" and a text area for the field "fulltext". The form saved the data correctly to j25_content as expected. There is only one entry in the d/b but...
when published, the article itself is displayed twice. (both title and content). There is only one version when viewed via article manager in the backend. Also, I notice CF is adding a "readmore" at the top of the article (i.e. before the copntent that was inputted via the form). This trait has been around since J1.5 versions not sure why.
also, Joomla version is 2.5.7. CF version is latest that can be downlaoded.
					Hi Anthony,
I am completely unable to get this to restore :-( That's unusual.
If I decode and unpack the CF4BAK file it looks as though you have a Select element with PHP in the Code box which is not valid; and a couple of Custom Element elements which include <doctype>, <head> and <body> tags - again these will cause problems.
ChronoForms shouldn't have any effect on the article display (unless the extra tags mentioned above have some side effect). The only times that I've seen content double-displayed has been from odd template or plug-in settings.
ChronoForms won't directly add a readmore to any article or have any other effect on it's presentation - Unless you are using the Submit Article action to create the article when it is possible.
Bob
				
				
				
			I am completely unable to get this to restore :-( That's unusual.
If I decode and unpack the CF4BAK file it looks as though you have a Select element with PHP in the Code box which is not valid; and a couple of Custom Element elements which include <doctype>, <head> and <body> tags - again these will cause problems.
ChronoForms shouldn't have any effect on the article display (unless the extra tags mentioned above have some side effect). The only times that I've seen content double-displayed has been from odd template or plug-in settings.
ChronoForms won't directly add a readmore to any article or have any other effect on it's presentation - Unless you are using the Submit Article action to create the article when it is possible.
Bob
					Hi Bob and Max,
the issue experienced is due to the ACL's in J1.6 and above. If the "created by" field is null or empty (i.e. not created by a registered user), it appears Joomla isn't quite sure who should be seeing the article.
so it displays it twice.
I resolved the problem of existing articles suffering the issue by editing them and selecting a user. Bingo, 2nd instance disappeared.
So, in order to get around this problem, it appears the article has to be submitted by a registered user. How do I setup that up in a form. prefer not to hard code it.
Thanks
Anthony
				
				
				
			the issue experienced is due to the ACL's in J1.6 and above. If the "created by" field is null or empty (i.e. not created by a registered user), it appears Joomla isn't quite sure who should be seeing the article.
so it displays it twice.
I resolved the problem of existing articles suffering the issue by editing them and selecting a user. Bingo, 2nd instance disappeared.
So, in order to get around this problem, it appears the article has to be submitted by a registered user. How do I setup that up in a form. prefer not to hard code it.
Thanks
Anthony
					Hi Anthony,
I'm confused about what you need to setup in the form. I don't think that the plug-in can check that the parent article has a user assigned? Or are you creating articles with the form?
Bob
				
				
				
			I'm confused about what you need to setup in the form. I don't think that the plug-in can check that the parent article has a user assigned? Or are you creating articles with the form?
Bob
					Hi Bob,
Sorry for the confusion. I'm creating new articles with the form. The form is available to the public, protected by captcha but no login is required. The form are used to gather articles for the football club newsletter and its twin (almost identical code, just more fields) is used to gather match reports from the weekend's football games.
The publication flow is below
1.The form gets submitted to a category that is "hidden" except to authorised users
2.The form doesn't get published until reviewed
3.The reviewer only has access from the f/end, so they can't changed the creator (modify the created_by field. This can only be achieved in Joomla when editing the article in the backend)
4. When reviewer accepts article for publication, they change the category and enable publication.
-Anthony
				
				
				
			Sorry for the confusion. I'm creating new articles with the form. The form is available to the public, protected by captcha but no login is required. The form are used to gather articles for the football club newsletter and its twin (almost identical code, just more fields) is used to gather match reports from the weekend's football games.
The publication flow is below
1.The form gets submitted to a category that is "hidden" except to authorised users
2.The form doesn't get published until reviewed
3.The reviewer only has access from the f/end, so they can't changed the creator (modify the created_by field. This can only be achieved in Joomla when editing the article in the backend)
4. When reviewer accepts article for publication, they change the category and enable publication.
-Anthony
					Hi Anthony,
I'm not sure how to handle this. The only suggestions that I can think of are either to require users to be logged in to create a new article; or to replace the Submit Article action with either a modified version or a hand-coded Custom Code action. The kind of code you need for this bit would be:
This code is around line 27 of /administrator/components/com_chronoforms/form_actions/submit_article/submit_article.php
Bob
				
				
				
			I'm not sure how to handle this. The only suggestions that I can think of are either to require users to be logged in to create a new article; or to replace the Submit Article action with either a modified version or a hand-coded Custom Code action. The kind of code you need for this bit would be:
<?php
//set data		
$user = JFactory::getUser();
if ( $user->id > 0 ) {
  // this is a registered user
  $form->data['created_by'] = $user->id;
} else {
  // this is a guest
  $form->data['created_by'] = 25;
}
?>This code is around line 27 of /administrator/components/com_chronoforms/form_actions/submit_article/submit_article.php
Bob
					Hi Bob,
I had thought about a solution along similar lines to your suggestion, so I already had some customer code in the form, so I added the code line simlar to yuor suggestion (see below) into the custom code I am using.
// this is a guest
$form->data['created_by'] = 25;
The other thought I had is to use a hidden field in the form and set the user ID value there. That way, when the post arroay is processed it'll be picked up.
Both solve the issue, but it does mean hard coding the outcome but it seems to be the only way to get around the problem as getting users to login is not an option.
Thanks for your help.
Anthony
				
				
				
			I had thought about a solution along similar lines to your suggestion, so I already had some customer code in the form, so I added the code line simlar to yuor suggestion (see below) into the custom code I am using.
// this is a guest
$form->data['created_by'] = 25;
The other thought I had is to use a hidden field in the form and set the user ID value there. That way, when the post arroay is processed it'll be picked up.
Both solve the issue, but it does mean hard coding the outcome but it seems to be the only way to get around the problem as getting users to login is not an option.
Thanks for your help.
Anthony
					Hi Anthony,
I don't think that the hidden input approach will work with the Submit Article action as ChronoForms take the value directly from $user->id and will over-write anything you add that way.
Bob
				
				
				
			I don't think that the hidden input approach will work with the Submit Article action as ChronoForms take the value directly from $user->id and will over-write anything you add that way.
Bob
This topic is locked and no more replies can be posted.
		
	
 
  