PDA

View Full Version : Pets with Blank/Empty Names


Kyttias
01-13-2015, 04:31 PM
Pets with no names cannot be managed.
My page to manage pets had its title set to just a variable containing the pet's name. But because the pet's name was blank, a white screen of death was thrown because titles must not be empty strings.

To remedy the problem I just added   to the end of the title (in myadoptsview.php, inside the manage() function), but, having pets with empty names could pose problems elsewhere in the site, as well.

I suggest all pets with a name of "" be renamed "Unnamed" or, alternatively, to it's species name. This should be done behind the scenes with the rename screen, of course.

MikiHeart
01-13-2015, 10:09 PM
A good idea could be to implant a check, to see if the user has entered a name for the pet. If you to force them to name the pet, show an error when it's left empty.

Or, you could just make the default value for the pet name "Unnamed"

I would have thought that it would force users to choose names anyhow.

I personally prefer the second option, and I will probably implant this myself. (I will share it when I do it) Thanks for bringing this to attention @.@