Apostrophe S

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Apostrophe S

Post by suzukiman1980 » Tue Jun 27, 2006 11:15 pm

Good day everyone.

I am a total Joomla! n00b but I have been recruited to build a website for my church. Everything has gone well until now but I've run into a problem I can't figure out.

I am creating a category called "Children's Ministries" under the section "Ministries". I have triple checked everything and nothing I do gets rid of the glitch. "Children's Ministries" appears as "Children/'s Ministries". Note the backslash before the apostrophe.

I have tried deleting the category and crating a new one and not even that solves the issue. Any suggestions?

User avatar
Steve
Joomla! Ace
Joomla! Ace
Posts: 1570
Joined: Tue Aug 23, 2005 1:02 pm
Location: Toowoomba
Contact:

Re: Apostrophe S

Post by Steve » Tue Jun 27, 2006 11:18 pm

Try turning of the editor in global Configurations  :)
Regards Steve, Developer of Export Content Component:
Component Information site
http://www.bestdownloadsites.com/joomla/export-content
http://www.bestdownloadsites.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Tue Jun 27, 2006 11:31 pm

Ok, changed the global config and no result. Same problem.
Last edited by suzukiman1980 on Tue Jun 27, 2006 11:37 pm, edited 1 time in total.

User avatar
Steve
Joomla! Ace
Joomla! Ace
Posts: 1570
Joined: Tue Aug 23, 2005 1:02 pm
Location: Toowoomba
Contact:

Re: Apostrophe S

Post by Steve » Tue Jun 27, 2006 11:59 pm

Did you redo the affected text?
What version of Joomla are you running?
Regards Steve, Developer of Export Content Component:
Component Information site
http://www.bestdownloadsites.com/joomla/export-content
http://www.bestdownloadsites.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Wed Jun 28, 2006 12:13 am

I totally rewrote the text. The only place I am having the problem is in the category name. When I type "Children's" in the text field for the body of the description I don't have any problem, it displays like it should.

I am using v1.08 with JCE as the text editor, but it makes no difference which editor I use.

User avatar
midwestkel
Joomla! Explorer
Joomla! Explorer
Posts: 367
Joined: Fri Apr 14, 2006 11:52 pm
Location: Colorado Springs, CO
Contact:

Re: Apostrophe S

Post by midwestkel » Wed Jun 28, 2006 12:32 am

J! will automatically put that in the admin side since it is PHP driven you need to put a "/" in front of " ' " Thats normal and will not show the "/" on the front end.

If you need anything else please let us know.
Kelly Karnetsky - I make websites for various reasons
█ I run a nifty game, entertainment & tech site http://flesheatingzipper.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Wed Jun 28, 2006 12:53 am

I've tried typing in "Children/'s", "Children\'s", "Children\s", "Children/s" with no positive results.

Result of "Children/'s" ----- "Children/\'s"
Result of "Children\'s" ----- "Children\\\'s"
Result of "Children\s" ----- "Children\\s"
Result of "Children/s" ----- "Children/s"

Any suggestions?

User avatar
midwestkel
Joomla! Explorer
Joomla! Explorer
Posts: 367
Joined: Fri Apr 14, 2006 11:52 pm
Location: Colorado Springs, CO
Contact:

Re: Apostrophe S

Post by midwestkel » Wed Jun 28, 2006 5:32 pm

No just put


Children's


It will look like


Children/'s

on the admin side but on the front end it will look like the first one.
Kelly Karnetsky - I make websites for various reasons
█ I run a nifty game, entertainment & tech site http://flesheatingzipper.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Wed Jun 28, 2006 9:28 pm

midwestkel wrote: No just put

Children's

It will look like

Children/'s

on the admin side but on the front end it will look like the first one.

It looks like Children\'s on both the front end and the back end. Here's what I'm looking at:

http://northshoreassembly.org/nsag2/ind ... &Itemid=36

User avatar
Steve
Joomla! Ace
Joomla! Ace
Posts: 1570
Joined: Tue Aug 23, 2005 1:02 pm
Location: Toowoomba
Contact:

Re: Apostrophe S

Post by Steve » Wed Jun 28, 2006 10:45 pm

Try upgrading to the latest version http://forum.joomla.org/index.php/topic,71966.0.html and see if that fixes it.
You only need to overwrite your files so it want affect the content you have entered.
Regards Steve, Developer of Export Content Component:
Component Information site
http://www.bestdownloadsites.com/joomla/export-content
http://www.bestdownloadsites.com

User avatar
midwestkel
Joomla! Explorer
Joomla! Explorer
Posts: 367
Joined: Fri Apr 14, 2006 11:52 pm
Location: Colorado Springs, CO
Contact:

Re: Apostrophe S

Post by midwestkel » Wed Jun 28, 2006 11:35 pm

I see what your saying I haven't had that problem and I am on 1.0.8
Kelly Karnetsky - I make websites for various reasons
█ I run a nifty game, entertainment & tech site http://flesheatingzipper.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Thu Jun 29, 2006 1:03 am

Ok, I updated from 1.0.08 to 1.0.10 and what you see is still there. There seems to be some sort of glitch with the ' in any title. I tried it on another title and it did the same thing although it doesn't happen in the body of a paragraph.

User avatar
midwestkel
Joomla! Explorer
Joomla! Explorer
Posts: 367
Joined: Fri Apr 14, 2006 11:52 pm
Location: Colorado Springs, CO
Contact:

Re: Apostrophe S

Post by midwestkel » Thu Jun 29, 2006 5:29 pm

Man beats me I tried to see if it would happen to me and it didnt. I would PM a moderator to see if they know about it.
Kelly Karnetsky - I make websites for various reasons
█ I run a nifty game, entertainment & tech site http://flesheatingzipper.com

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Thu Jun 29, 2006 8:01 pm

I'll do that.

Odd, isn't it? I've never seen anything like it before.

Thx for your help. If I can get a resolution to the issue I will definately post it.

User avatar
nathandiehl
Joomla! Champion
Joomla! Champion
Posts: 6044
Joined: Fri Aug 19, 2005 3:03 pm
Location: Indiana, USA
Contact:

Re: Apostrophe S

Post by nathandiehl » Fri Jun 30, 2006 12:28 pm

see this link:
http://northshoreassembly.org/nsag2/ind ... &Itemid=40

there are five apostrophes here, and all look good--including three Children's Ministry that was in question.

Have you cleared teh cache? (from backend, system-->clear all cache  --if the option isn't there, it isn't enabled, which is okay)

If still an issue, i would recommend:
1. create a new, different category (same section as Children's Ministry)
2. copy all content items over from old category to new category
3. re-create menu item links to the new category, deleting old ones
4. delete old category.


hope this helps. certainly an odd issue.
If you're new to Joomla, Please read Anna's Joomla! Tips: http://forum.joomla.org/viewtopic.php?t=5503

http://nathandiehl.com | Find out what makes me tick

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Fri Jun 30, 2006 6:06 pm

nathandiehl wrote: see this link:
http://northshoreassembly.org/nsag2/ind ... &Itemid=40

there are five apostrophes here, and all look good--including three Children's Ministry that was in question.

Have you cleared teh cache? (from backend, system-->clear all cache  --if the option isn't there, it isn't enabled, which is okay)

If still an issue, i would recommend:
1. create a new, different category (same section as Children's Ministry)
2. copy all content items over from old category to new category
3. re-create menu item links to the new category, deleting old ones
4. delete old category.


hope this helps. certainly an odd issue.
I checked and the server cache option is off. I cleared my browser cache in both IE and Firefox again before viewing the pages that have the problem and I still see \'

I created a new Children's Ministries category, made new menu links, moved the content, and deleted the old category and the problem still exists. I'm out of ideas, aside from being grammatically incorrect and use "Childrens" instead of "Children's".

EDIT: I have tried adding a different category named "Men's Ministries" and I have the same problem. You can see it here:

http://northshoreassembly.org/nsag2/ind ... &Itemid=43
Last edited by suzukiman1980 on Fri Jun 30, 2006 6:20 pm, edited 1 time in total.

User avatar
nathandiehl
Joomla! Champion
Joomla! Champion
Posts: 6044
Joined: Fri Aug 19, 2005 3:03 pm
Location: Indiana, USA
Contact:

Re: Apostrophe S

Post by nathandiehl » Fri Jun 30, 2006 6:43 pm

can you duplicate what you're doing on the Demo site?
http://demo.joomla.org
If you're new to Joomla, Please read Anna's Joomla! Tips: http://forum.joomla.org/viewtopic.php?t=5503

http://nathandiehl.com | Find out what makes me tick

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Fri Jun 30, 2006 11:38 pm

Yes, it seems to be doing it on the demo site as well. I created a category under News named "NSAG's Test". See the screenshots below.

Image

Image

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

Re: Apostrophe S

Post by codecontractor » Sun Jul 02, 2006 5:14 am

I had the same problem and hacked a solution...

In components / com_content / content.html.php

lines 134 and 135 read:

Code: Select all

<a href="<?php echo $link; ?>" class="category">
	<?php echo $row->name;?></a>
This needs to be changed to:

Code: Select all

<a href="<?php echo $link; ?>" class="category">
	<?php echo stripslashes($row->name);?></a>
Is there a way to communicate this to the dev team to let them know because this is a change they should make to the release?

-Ben
Benjamin Stookey
(CodeContractor)

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

One more hack

Post by codecontractor » Sun Jul 02, 2006 5:34 am

I noticed that the same problem occurs if you show the category below the title of a content item.

You just have to add the stripslashes function to this function at line 777.

joomla version: 1.0.10

Code: Select all

	/**
	* Writes Category
	*/
	function Category( &$row, &$params ) {
		if ( $params->get( 'category' ) ) {
			?>
			<span>
				<?php
				echo stripslashes($row->category);
				?>
			</span>
			<?php
		}
	}
I'll add here that I'm going to add a class to the span for my own use. I would recomend it for customization in the future.
Benjamin Stookey
(CodeContractor)

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Sun Jul 02, 2006 1:06 pm

Well, that got me closer!!

I'm still having problems with the category name when it displays the content items in the category. See screenshot below:

Image

I appreceate the help you're giving me. Any other ideas? I have never seen anything be this stubborn before!

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

Re: Apostrophe S

Post by codecontractor » Sun Jul 02, 2006 6:37 pm

I can't seem to duplicate that problem myself. Are you sure you haven't got the slash in the title itself?

You can try the following hack at line 44 of the same file:

Code: Select all

		if ( $params->get( 'page_title' ) ) {
			?>
			<div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
			<?php echo stripslashes($title->name); ?>
			</div>
			<?php
		}
Once again the version is 1.0.10.

I hope that works.
Benjamin Stookey
(CodeContractor)

suzukiman1980
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Jun 22, 2006 11:35 am

Re: Apostrophe S

Post by suzukiman1980 » Sun Jul 02, 2006 8:12 pm

codecontractor wrote: I can't seem to duplicate that problem myself. Are you sure you haven't got the slash in the title itself?

You can try the following hack at line 44 of the same file:

Code: Select all

		if ( $params->get( 'page_title' ) ) {
			?>
			<div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
			<?php echo stripslashes($title->name); ?>
			</div>
			<?php
		}
Once again the version is 1.0.10.

I hope that works.



BINGO!!!!  :D

Ben, you nailed it!!!! That was the final solution to remove the slash. Truely I am in the presence of greatness!

Thank you so much. You da man!

sashen
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Fri Jun 23, 2006 6:42 am

Re: Apostrophe S

Post by sashen » Sun Jul 02, 2006 9:45 pm

CodeContractor....

Thanks so much ... I made the changes you suggested (at least I think I did), but I'm still having ONE problem:

1) Hover over "Keyword Article 1's" (where you see one of the places the solution IS working) and you'll see this path:

http://recreationdigest.com/recreation' ... e-1's.html

"recreation-travel's" is the category. (recreation's is the section)...

Here's what I think is the relevant code section:

Code: Select all

	/**
	* Writes Section
	*/
	function Section( $row, $params ) {
		if ( $params->get( 'section' ) ) {
				?>
				<span>
				<?php
				echo stripslashes($row->section);
				// writes dash between section & Category Name when both are active
				if ( $params->get( 'category' ) ) {
					echo ' - ';
				}
				?>
				</span>
			<?php
		}
	}

	/**
	* Writes Category
	*/
	function Category( $row, $params ) {
		if ( $params->get( 'category' ) ) {
			?>
			<span>
			<?php
			echo stripslashes($row->category);
			?>
			</span>
			<?php
		}
	}
Any hints?

THANKS!


(oh, I'm using 1.0.8 )
Last edited by sashen on Sun Jul 02, 2006 10:02 pm, edited 1 time in total.

azorn
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Apr 20, 2006 4:17 pm

Re: Apostrophe S

Post by azorn » Mon Jul 03, 2006 2:13 pm

The problem is further upstream.

I have exactly the same problem (maybe Joomla doesn't like Children's Ministries  ;)).  Creating a new category didn't solve the problem, I had the same thing happen again.

When I look in the database, jos_categories table, I found the title was stored as "Children\'s Ministries".  Going in and taking out the backslash in the data solved the problem. 

Of course, you don't want to be doing that all the time, but it says to me that somewhere there are too many addslashes before the title gets stored - "Children's" gets changed to "Children\'s" correctly but then, somehow that gets changed to "Children\\\'s" before the text is written to the database. 

FWIW, I also tried deleting the category  when it still had content and I got an error message that "Children\\\\\\\'s Ministry" still had content - talk about addslash overload!

I also see that categories created by DocMan don't have the extra slash.  Maybe there's a hint in there.

I'll try to hunt around in the source, but I thought I'd toss this out to those who know their way around it a little better.

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

Apostrophe in URL

Post by codecontractor » Mon Jul 03, 2006 3:57 pm

Sashen,

What SEO tool are you using? It's obviously not the standard SEF links because those are written:

content/category/1/1/2/

It sounds like the problem is in the tool that generates the links...

-Ben
Benjamin Stookey
(CodeContractor)

sashen
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Fri Jun 23, 2006 6:42 am

Re: Apostrophe in URL

Post by sashen » Mon Jul 03, 2006 4:25 pm

codecontractor wrote: Sashen,

What SEO tool are you using? It's obviously not the standard SEF links because those are written:

content/category/1/1/2/

It sounds like the problem is in the tool that generates the links...

-Ben
I'm using SEF Advance.

I don't think that's causing the problem since the solution codecontractor gave worked everywhere but that ONE place... it worked in the Section part of the URL link, e.g.

-Sashen

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

The problem is in SEF Advance

Post by codecontractor » Mon Jul 03, 2006 5:01 pm

The code I edited above solved the problem within the content component of the site. This doesn't solve the problem when it comes to SEF links. This is because of a function called sefRelToAbs:

Code: Select all

/**
 * Converts an absolute URL to SEF format
 * @param string The URL
 * @return string
 */
function sefRelToAbs( $string )
You may notice it is called above. This function strips the GET text from the url and converts it to SEF format (with /'s).

I don't know, but I assume that the SEF Advance component overrides this function and then queries the database for the names associated with the ID's of the categories, sections, and content items. I'm not going to pay 40 quid to check for you though.  :-\

Anyway, the com_content component doesn't write the SEF url. SEF Advance does and gets the category name directly from the DB so the stripslashes function is missing somewhere in Emir Sakic's code. I suggest you bring it up with him.

-Ben
Benjamin Stookey
(CodeContractor)

codecontractor
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jul 02, 2006 5:06 am
Location: Surfside Beach, SC
Contact:

Re: Apostrophe S

Post by codecontractor » Mon Jul 03, 2006 11:52 pm

Ok, well I see part of the problem...

In the DB apostrophes are handled differently between categories and sections.

That is, if you create a new Section with an apostrophe in it there are no slashes in the jos_sections table, but if you create a new Category with an apostrophe it is stored as /' in the jos_categories table. They do this explicitly in the code for categories, but not for Sections and I haven't been able to figure out why. Things seem to work fine if you remove the apostrophes in the DB though.

I've made a small change in administrator/components/com_categories/admin.categories.php

Code: Select all

/**
* Saves the catefory after an edit form submit
* @param string The name of the category section
*/
function saveCategory( $task ) {
....
....
// 	$row->title 		= addslashes( $row->title );
// 	$row->name		= addslashes( $row->name );
	$row->title 		= $row->title;
	$row->name		= $row->name;
This stops the category from being saved in the DB with the slash. I've tested this a little, but I can't guarantee that this doesn't seriously damage the system... ???

I would recommend going directly into your db and adjusting the jos_categories table to remove the /' in title and name to test things first. Then, if your site still works, make the changes in the code.

I would also recommend uninstalling/reinstalling SEF Advance -- and I don't know why, but that worked for me on my test system.

-Ben

joomla version: 1.0.10
Benjamin Stookey
(CodeContractor)

Zardoz
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Mon Jan 16, 2006 3:59 am
Location: USA
Contact:

Re: Apostrophe S

Post by Zardoz » Tue Jul 04, 2006 12:45 am

Hi, glad I ran across this thread. I noticed the same issue with apostrophes before and simply changed the name of the catagory so it didn't use an apostrophe.  :( (Not very technical, I know, but I'm really uncomfortable messing with code.) I simply named it back to recreate the issue.

In case this is of help, I'm not using any SEF other than Joomla's built-in version.

Joomla! version 1.0.8
Community Builder
JCE
Joomap
JoomlaBoard
JoomlaExplorer

Sorry, but the code hacking thing is way over my head.

HTH


Locked

Return to “General Questions - 1.0.x”