Predefined Lists Language Bug

Ok, I've encountered a really odd problem.  If I try to add ("+") an entry to the existing "Language" list under Predefined Values, then when I press "Save" the admin panel brings up a login prompt and says:

 

"Sorry, you need to login before you can use this page."

 

I enter my username and password again and none of my changes are saved.

 

This happens only to the Language list.  I can apparently edit other built-in lists successfully, like Religion, and I've created several new lists and edited them.  Language list is the only one giving the error.

 

Any ideas?

Quote · 3 Nov 2009

try this :

check for special characters change it to URLENCODE string.

Live Support http://dolphinbugfixing.com
Quote · 3 Nov 2009

 

try this :

check for special characters change it to URLENCODE string.

 

Well, the Language list that comes with Dolphin is pretty standard (the default height table entries are quite a mess) and what I'm trying to add doesn't have any special characters.  For examples "53  __Irish" 

 

I have narrowed it down a bit though - it's a matter of list size.  I'm beginning to think it's some sort of data overflow from too much post data.

 

First, I opened up admin/preValues.php and searched through the headers to find that the call to member_auth is what makes sure you're logged in as admin and asks you to login if you're not.  Figuring I could just disable this line for the time being as a hack, I did, but the problem of not saving still persists.

 

Playing on a hunch it had something to do with the large size of the list, I went to the 2nd largest "Religion" and started adding entries.  Lo and behold, I could add the 27th entry (if I was authenticated) or 28th entry (if I wasn't), but the one after that - every time - it wouldn't save any new data.  If I deleted some I could add back in new ones.  But 27-28 is about the maximum limit until something breaks.

 

Could this be some stack overflow of the post data from the form?  Can this be related to my server setup somehow, or is it a Dolphin issue?  If if is a Dolphin issue, do you suppose they just used direct database INSERT queries to get the Language list in there in the first place, since it appears the admin panel interface can't handle a list that big?

 

I'm kind of in a toss up between hunting down more information about the bug or just trying to hack it so I can get the darn data in.  I might have to edit some lists this large from time-to-time, but maybe not too often.

Quote · 4 Nov 2009

I tried to replicate this for you on my test domains and here's what I tried:

 

1.  I added 4 items to the Country list successfully

 

2.  I added 4 items to the Religion list successfully

 

3.  I created a new PDV List of 30 items successfully. 

 

Note:  This was on a dedicated server running php 5.2.9 w/apache config'd for suPHP and all items working correctly as far as ray & so on goes. 

 

Now as far as how the list got created initially, it's through the install/sql file that you run during the installation of your site.  To create an SQL for this you just need to adjust this right here:

 

INSERT INTO `PreValues` VALUES('Country', 'ZM', 237, '__Zambia', '', '', '', '', '');
INSERT INTO `PreValues` VALUES('Country', 'ZW', 238, '__Zimbabwe', '', '', '', '', '');

 

 

You just need to find the name of the list you want to add them to and what the highest order # is.  For example, in country the highest order # is "238" so you would make the next one 239, 240, 241 and so on.  As long as you have not modified then you will be find.  Make sure you copy paste the list and only alter the items in between the apostrophes and keep the apostropes in it.  (Do not use words like I'm, We're, They're as the extra apostrophe will cause you errors).  The ZM & ZW are the Value. 

 

Once you have what you want for a list, just go ahead and save it in Notepad++ as a text file and then upload it as an SQL query to your server.  It'll run and set the pre-defined list for you.  If you have doubts then run this real quick:

 

INSERT INTO `PreValues` VALUES('Country', 'ZZ', 239, '__Zoo', '', '', '', '', '');
INSERT INTO `PreValues` VALUES('Country', 'ZQ', 238, '__Zimquebec', '', '', '', '', '');

 

 

Note the changes that were done and this will add 2 items to the bottom of your Pre-Defined Values Country List.

 

Good Luck!

 

 

 

Quote · 4 Nov 2009

Well, sounds like I might have to try dumping the POST data to a file then to figure out what's wrong my server.  Does that sound best?

 

I decided to hack it for now, and in some ways, it's a bit faster since pressing the up arrow over and over can get quite tedious.  When I first did it and it ate my updates, it took 20 minutes.

 

So, I did do raw INSERT's but it's a bit more than that.  In case anyone needs to, here's how you do it:

 

First off, the PreValues table's columns are the following:

Key, Value, Order, LKey, LKey2, LKey3, Extra, Extra2, Extra3

 

Key is the name of the list.

Value is the value from the left most column in the admin editor.  The key value you set that doesn't really matter as long as it is unique.

Order is the number that specified the ordering of the list, as the page creation functions do an ORDER clause on this field.

 

One thing I realized that was really smart in the development of this: why have both key and order? Answer: backward compatibility.  You don't want your users to have to reselect their values everytime you change a list.  Their selections are pointed to the Key field, so these should never change.  The ordering field allows you to reorder to add things in the middle of the list, while still adding new, unused keys.

 

1. I took a dump of the database through the admin panel.  I took the necessary parts and put them in a new SQL file like this:

 


DELETE FROM `PreValues` WHERE `Key` = 'Language';
INSERT INTO `PreValues` VALUES ('Language', '0', '0', '__English', '', '', '', '', '');
INSERT INTO `PreValues` VALUES ('Language', '1', '1', '__Afrikaans', '', '', '', '', '');
INSERT INTO `PreValues` VALUES ('Language', '2', '2', '__Arabic', '', '', '', '', '');
INSERT INTO `PreValues` VALUES ('Language', '59', '3', '__Breton', '', '', '', '', '');
INSERT INTO `PreValues` VALUES ('Language', '3', '4', '__Bulgarian', '', '', '', '', ''); ... INSERT INTO `PreValues` VALUES ('Language', '58', '60', '__Welsh', '', '', '', '', '');

-- 2009-11-10: Added Czech, Solvak, Irish, Scottish Gaelic, Manx, Welsh, Breton, Cornish
--   values 53-60


 

2. I used the Admin|Tools|Database Backup|Restore from your PC to upload the file to apply the changes, rather than writing a PHP script to do all the MySQL queries.  Of course, you probably have direct access to your MySQL command line on your system and can do it there.  (I just haven't gotten around to asking my co-admin for access.)

 

3. The updated list will now appear in your Admin|Predefined Values section but it won't update on the site.  Why?  I hunted into /admin/PreValues.php and found you need to recompile.  When you save a list, it runs the generic compilePreValues()function.  So pick any small list, don't make any changes to it, and "Save" it.  Now changes will be reflected on your site.

 

Quote · 10 Nov 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.