Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Upgrading to 1.5.x / Admin Pages again

Admin Pages again

Started by niccol on 6 Jan 2012, 10:55 AM · Views: 1,803

Results 1 to 8 of 8
6 Jan 2012, 10:55 AM
#1
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Admin Pages again

Sorry, another question about admin pages and registration.

Unusually, I am trying to slot a admin page into the original sort order. Normally of course it should appear at the bottom. In this case I am trying to put it under 'featured'. In the past I have just used the same sort order as 'featured'.

When I try that now here are the results I get.

First of all as an example

table admin_pages
page_parameters - gID=79
sort_order = 22

table configuration group
configuration_group_id = 79
sort_order = 22

When I create those setting manually in phpMyAdmin everything works except that the item appears one line lower than expected. Below All Listing which has a sort order of 23. Which is kind of strange.

If I create those settings programatically then the page is accessible and in the same place in the menu. However the menu items on that page to not show. (If I then edit the sort orders manually they appear which suggests that everything in table configuration is right)

So questions:

Is it possible to put an item directly under an existing item? To explain, I have a mod that creates options for the specials page and it kind of makes sense to put it here as a Specials Listing menu Item.

What does the sort_order in the configuration_group actually do?

It is not a big deal. I'll go back to putting it all at the bottom of the list for the time being but it would be nice to now if it is possible.

Thanks for the help

Nick
iszent.com

6 Jan 2012, 11:16 AM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Admin Pages again

If I create those settings programatically then the page is accessible and in the same place in the menu. However the menu items on that page to not show. (If I then edit the sort orders manually they appear which suggests that everything in table configuration is right)

OK. that bit of the issue was due to stupidity on my part.

However, I still have an issue witht he sort order and the item appearing one lower than I would expect.

And would appreciate advice about whether this is just a bad thing to do.

Nick
iszent.com

6 Jan 2012, 12:31 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Pages again

I recommend double checking the sort orders. By default the All listing has a gID of 23, but its sort order is 22. So by putting your new page in with the same sort order, which comes first is a bit random.

Well maybe not completely random, I'd expect the all to come out first most of the time as it appears earlier in the table than the new entry, but sometimes things may get switched around depending upon how mysql builds a particular query internally.

To ensure that the new entry comes where you want you need to shuffle the other sort orders up to make space.

Something like this would do it:

UPDATE admin_pages SET sort_order = sort_order + 1 WHERE menu_key = "configuration" AND sort_order >= 22;

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

6 Jan 2012, 1:03 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Admin Pages again

Yes.

I had thought of shuffling the order as described but to be honest as long as it appears in the ballpark (somewhere in all, featured, new listings) it is not a big deal about the random(ish) mysql factor.

So, does the sort order in configuration_group do anything in 1.5? Or is that redundant?

Thanks for your time , Kuroi. Much appreciated.

Nick
iszent.com

6 Jan 2012, 1:14 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Pages again

Ah good point. Penny drops. I believe that the configuration group table sort order settings have been superceded by the admin page table's version, making the former redundant (i.e. I can't think of anywhere that would use that now).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

6 Jan 2012, 1:59 PM
#6
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Admin Pages again

Thanks, Kuroi, for solving my confusion.

Nick
iszent.com

6 Jan 2012, 2:01 PM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Admin Pages again

I think the confusion is in the code (I forgot about the old sort order) - you've helped provide clarity.

:thumbsup:

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

6 Jan 2012, 9:03 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Admin Pages again

niccol:

What does the sort_order in the configuration_group actually do?

The sort_order in the configuration_group TABLE is no longer used as of v1.5.0

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.