Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-09 19:10:28

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

form override

I have a section whose page uses with two columns:

In one column I have the following:

<txp:article limit="1" />

In the second column I have:

<txp:if_section name="sundays">
<txp:if_individual_article>
<txp:article_custom section="sundays" category="side-note" form="sidenote-style" limit="1" status="live" />
</txp:if_individual_article>
</txp:if_section>

The problem occurs when I use ign_password_protect around a file list, on the occasion that I override the article’s form.
The article in the first column is correctly overridden, but the article in the second column is overridden as well, and becomes the article in the first column (essentially there are two of the same article now).

I am assuming its not an issue with ign pass protect, as I simply placed the form in the page directly (rather than using override) and it did not have this effect.

Can anyone give me a reason this is occuring?

Thank you,

Matthew


Offline

#2 2007-05-09 19:22:45

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: form override

Try adding allowoverride="0" to the article_custom tag.

Offline

#3 2007-05-09 19:37:16

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: form override

:( no go.
Good thought though.

Here’s the tag trace:

<!-- Runtime:    0.1650 -->
<!-- Query time: -3.281992 -->
<!-- Queries: 30 -->
<!-- Memory: no info available -->
<!-- txp tag trace: 
[SQL (0.004451): select name from `txp_lang` where lang='en-us' limit 1]
[SQL (0.009159): select name, data from `txp_lang` where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.042703): select name, code from `txp_plugin` where status='1']
[SQL (0.003438): select ID,Section from `textpattern` where url_title like 'bulletins' AND Section='sundays' limit 1]
[SQL (0.001583): select * from `txp_section` where name = 'sundays' limit 1]
[SQL (0.000840): select Posted, AuthorID, Keywords from `textpattern` where ID=86]
[SQL (-1.695459): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2007-02-14 09:31:00' and Section = 'sundays' and Status=4 and Posted < now() order by Posted asc limit 1]
[SQL (0.001575): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2007-02-14 09:31:00' and Section = 'sundays' and Status=4 and Posted < now() order by Posted desc limit 1]
[SQL (0.000741): select RealName from `txp_users` where `name` = 'admin' limit 1]
[SQL (0.000942): select host from `txp_log` where ip='67.62.106.50' limit 1]
[SQL (0.000705): insert into `txp_log` set `time`=now(),page='/sundays/bulletins',ip='67.62.106.50',host='static-67-62-106-50.dsl.cavtel.net',refer='',status='200',method='GET']
[SQL (0.001112): select user_html from `txp_page` where name='default-backup']
[Page: default-backup]
<txp:output_form form="dtd_head" />
	[SQL (0.000687): select form from `txp_form` where `name` = 'dtd_head' limit 1]
	<txp:site_url/>
	<txp:page_title/>
		[SQL (0.004903): select Title from `textpattern` where ID = 86]
<txp:section/>
<txp:output_form form="church_info" />
	[SQL (0.000746): select form from `txp_form` where `name` = 'church_info' limit 1]
	<txp:article_custom section="announcements" limit="1" />
		[SQL (1.701102): select *, unix_timestamp(Posted) as uPosted from `textpattern` where 1 and Status='4' and Posted < now() and Section = 'announcements' order by Posted desc limit 0, 1]
		[SQL (0.007264): select Form from `txp_form` where `name` = 'default' limit 1]
		[Form: default]
	<txp:upm_textile>
	</txp:upm_textile>
<txp:output_form form="top_nav_images" />
	[SQL (0.001282): select form from `txp_form` where `name` = 'top_nav_images' limit 1]
	<txp:if_section name=",about-us">
		[<txp:if_section name=",about-us">: false]
		<txp:site_url/>
	</txp:if_section>
	<txp:if_section name="sundays">
		[<txp:if_section name="sundays">: true]
		<txp:section/>
		<txp:site_url/>
	</txp:if_section>
	<txp:if_section name="small-groups">
		[<txp:if_section name="small-groups">: false]
		<txp:site_url/>
	</txp:if_section>
	<txp:if_section name="ministries">
		[<txp:if_section name="ministries">: false]
		<txp:site_url/>
	</txp:if_section>
	<txp:if_section name="support-us">
		[<txp:if_section name="support-us">: false]
		<txp:site_url/>
	</txp:if_section>
<txp:output_form form="top_nav" />
	[SQL (0.000668): select form from `txp_form` where `name` = 'top_nav' limit 1]
	<txp:section/>
<txp:if_section name=",about-us">
	[<txp:if_section name=",about-us">: false]
	<txp:chh_article_custom section="?" category="main-article" listform="sub-links" />
		[SQL (-1.693483): select *, unix_timestamp(Posted) AS uPosted from `textpattern` where 1 and Status='4' AND Posted < now() AND ( (Category1 = 'main-article' OR Category2 = 'main-article') ) AND ( (Section = 'sundays') )  ORDER BY Posted desc LIMIT 0, 10]
		[SQL (0.000970): select Form from `txp_form` where `name` = 'sub-links' limit 1]
		[Form: sub-links]
		[article 94]
		<txp:php>
		</txp:php>
		<txp:permlink/>
		<txp:title/>
		<txp:title/>
		[article 87]
		<txp:php>
		</txp:php>
		<txp:permlink/>
		<txp:title/>
		<txp:title/>
		[article 86]
		<txp:php>
		</txp:php>
		<txp:permlink/>
		<txp:title/>
		<txp:title/>
</txp:if_section>
<txp:if_section name=",about-us">
	[<txp:if_section name=",about-us">: false]
</txp:if_section>
<txp:if_section name="ministries">
	[<txp:if_section name="ministries">: false]
</txp:if_section>
<txp:if_section name="small-groups">
	[<txp:if_section name="small-groups">: false]
</txp:if_section>
<txp:if_section name="sundays">
	[<txp:if_section name="sundays">: true]
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:article limit="1" />
			[SQL (0.001309): select *, unix_timestamp(Posted) as uPosted from `textpattern` where ID='86' and Status in (4,5) limit 1]
			[article 86]
			[SQL (-1.695786): select Form from `txp_form` where `name` = 'default_protected' limit 1]
			[Form: default_protected]
			<txp:rss_article_edit>
			</txp:rss_article_edit>
			<txp:title/>
			<txp:body/>
			<txp:ign_password_protect err_msg="I'm sorry that username/password combination does not exist, if you continue to have trouble, please email jason@citychurchphilly.com" login_msg="To view the files below, you must first log in with the citychurch username and password" remember="1">
			</txp:ign_password_protect>
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: false]
			</txp:if_comments_allowed>
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: false]
			</txp:if_comments_allowed>
			<txp:comments/>
				[SQL (0.000717): select Form from `txp_form` where `name` = 'comments' limit 1]
				[Form: comments]
				[SQL (0.000881): select *, unix_timestamp(posted) as time from `txp_discuss` where parentid='86' and visible=1 order by posted asc]
			<txp:if_comments_preview>
				[<txp:if_comments_preview>: false]
				<txp:if_comments_allowed>
					[<txp:if_comments_allowed>: false]
				</txp:if_comments_allowed>
			</txp:if_comments_preview>
			<txp:if_comments_disallowed>
				[<txp:if_comments_disallowed>: true]
			</txp:if_comments_disallowed>
	</txp:if_individual_article>
</txp:if_section>
<txp:if_section name="support-us">
	[<txp:if_section name="support-us">: false]
</txp:if_section>
<txp:output_form form="sidebar" />
	[SQL (0.001373): select form from `txp_form` where `name` = 'sidebar' limit 1]
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:article form="sidenote" limit="1" status="live" />
			[SQL (0.002083): select *, unix_timestamp(Posted) as uPosted from `textpattern` where ID='86' and Status='4' limit 1]
			[article 86]
			[Form: default_protected]
			<txp:rss_article_edit>
			</txp:rss_article_edit>
			<txp:title/>
			<txp:body/>
			<txp:ign_password_protect err_msg="I'm sorry that username/password combination does not exist, if you continue to have trouble, please email jason@citychurchphilly.com" login_msg="To view the files below, you must first log in with the citychurch username and password" remember="1">
			</txp:ign_password_protect>
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: false]
			</txp:if_comments_allowed>
			<txp:if_comments_allowed>
				[<txp:if_comments_allowed>: false]
			</txp:if_comments_allowed>
			<txp:comments/>
				[Form: comments]
				[SQL (0.001598): select *, unix_timestamp(posted) as time from `txp_discuss` where parentid='86' and visible=1 order by posted asc]
			<txp:if_comments_preview>
				[<txp:if_comments_preview>: false]
				<txp:if_comments_allowed>
					[<txp:if_comments_allowed>: false]
				</txp:if_comments_allowed>
			</txp:if_comments_preview>
			<txp:if_comments_disallowed>
				[<txp:if_comments_disallowed>: true]
			</txp:if_comments_disallowed>
	</txp:if_individual_article>
	<txp:if_section name="support-us">
		[<txp:if_section name="support-us">: false]
	</txp:if_section>
<txp:output_form form="footer" />
	[SQL (0.000614): select form from `txp_form` where `name` = 'footer' limit 1]
[ --- secondpass --- ]
 -->

Last edited by ma_smith (2007-05-09 19:37:34)


Offline

#4 2007-05-10 01:22:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: form override

I don’t see the article_custom tag you refer to in there. All I can see are these:

<txp:if_section name="sundays">
	<txp:if_individual_article>
		<txp:article limit="1" />
	</txp:if_individual_article>
</txp:if_section>
<txp:if_individual_article>
	<txp:article form="sidenote" limit="1" status="live" />
</txp:if_individual_article>

Are you sure the right page is being used?

Offline

#5 2007-05-10 01:41:26

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: form override

Mary,
In the form sidenote:

<txp:if_section name="sundays">
	<txp:if_individual_article>
	<txp:article_custom section="sundays" category="side-note" form="sidenote-style" limit="1" allowoverride="0" status="live" />
	</txp:if_individual_article>
	</txp:if_section>

Am I botching this by using an article form within an article form?


Offline

#6 2007-05-10 02:06:28

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: form override

That’s a possibility. I don’t think the tag trace can handle that, so it can’t tell us one way or the other.

Offline

#7 2007-05-10 02:14:28

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: form override

gotcha. Any suggestions?


Offline

#8 2007-05-10 02:39:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: form override

All I can suggest is to try and find a slightly different way of doing what you want to achieve. Why do you need to call another article from within another? I’m guessing you’ve shifted some logic to your article’s form when it might be better within your page itself.

Offline

#9 2007-05-10 06:44:48

anoke
Archived Plugin Author
Registered: 2006-04-15
Posts: 152

Re: form override

BTW, does <txp:if_section name=",about-us"> catch both default and about-us? Didn’t knew that..


- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -

Offline

#10 2007-05-10 17:01:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: form override

Matthew, try making form ‘sidenote’ a misc form, and call it with txp:output_form in stead of txp:article. This form doesn’t have to be an article form.

Offline

#11 2013-11-01 15:07:27

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: form override

Hi, I’m using this old post for a new question related to the ‘Override form’ option.
I’m working on an old website to apply new pages and styles. There were two used forms for articles, one which was the default form, and one which was an overriding form. I imported every articles in a fresh Txp install and now, I would like to set the ‘Override form’ option of every articles for which this option is empty to the old default form and use a new default form for new articles. I think that the best way is to use an SQL request in MySQL but I don’t know how to do.
If you understand what I would like to do (?!) let me know…
Thanks!

Last edited by NicolasGraph (2013-11-01 15:08:01)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#12 2013-11-01 16:35:45

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: form override

The following should work:

UPDATE textpattern SET override_form = new_form_name WHERE override_form='';

Where “new_form_name” is the equivalent to your “old default form”

Update Backup before, just in case.

Last edited by uli (2013-11-01 16:36:30)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB