Author Topic: nws-alerts sort issue  (Read 1153 times)

0 Members and 1 Guest are viewing this topic.

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
nws-alerts sort issue
« on: January 22, 2017, 11:06:44 PM »
Just discovered my alerts are no longer in order. My NWSalertsCodes array is in alpha order with the exception of Phoenix being first, and I have $locSort = 0; (sort location as listed in $myZC array) in alerts-config. No changes have been made in this area in some time.

Thoughts appreciated.
John
W7JKG

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: nws-alerts sort issue
« Reply #1 on: January 23, 2017, 05:23:59 AM »
Does the array in Settings.php match the array in the file nws-alerts-config.php?

This is in the nws-alerts-config.php file:
Code: [Select]
$myZC = array(
"Phoenix|AZZ023|AZC013",
"Apache County|AZZ014|AZZ114|AZC001",
"Cochise County|AZZ508|AZC003",
"Coconino County|AZZ007|AZC005",
"Gila County|AZZ018|AZZ024|AZC007",
"Graham County|AZC009",
"Greenlee County|AZZ510|AZC011",
"La Paz County|AZC012",
"Maricopa County|AZZ022|AZZ027|AZC013",
"Mohave County|AZZ002|AZC015",
"Navaho County|AZZ113|AZC017",
"Pima County|AZZ501|AZC019",
"Pinal County|AZZ028|AZC021",
"Santa Cruz County|AZC023",
"Yavapai County|AZZ037|AZZ108|AZC025",
"Yuma County|AZZ025|AZZ131|AZC027"
);


Having $locSort set at 0, it will list Phoenix first unless you change $locSort to 1.
Code: [Select]
$locSort       = 0;            // location name sort - use number listed below
//                                0 = sort location as listed in $myZC array
//                                1 = sort location alphabetically

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: nws-alerts sort issue
« Reply #2 on: January 23, 2017, 11:21:28 AM »
Yes, both arrays are exactly the same (did a copy/paste when building the nws-alerts array just to be sure).
Phoenix is first deliberately in the array along with the '0' sort item so it will list first.

Not sure when this started as it used to list in order. Alerts here have been extremely active and heavy lately. Still many today and still messed up as you probably saw.

Thanks, Curly.
John
W7JKG

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: nws-alerts sort issue
« Reply #3 on: January 23, 2017, 11:29:21 AM »
Just got a notification that zone numbers for WFO Phoenix will be changing effective 4 April. More work ahead...
John
W7JKG

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: nws-alerts sort issue
« Reply #4 on: January 23, 2017, 12:09:36 PM »
GR2AE, GR3, Cumulus

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: nws-alerts sort issue
« Reply #5 on: January 23, 2017, 12:14:11 PM »
See here:  http://www.wxforum.net/index.php?topic=31285.0
Yep, exactly what I got (along with a number of other notices).
John
W7JKG

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: nws-alerts sort issue
« Reply #6 on: January 23, 2017, 08:57:30 PM »
I did spot the sorting issue in the script but it will take a few days to fix it.
This miserable flu bug that I have is putting a damper on things...

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: nws-alerts sort issue
« Reply #7 on: January 23, 2017, 09:27:50 PM »
Get better first, Curly. This bug is a minor annoyance.

Thanks for the update, now back to bed!
John
W7JKG

Offline RickNY

  • Contributor
  • ***
  • Posts: 116
    • College Hills Weather - Farmingville, NY
Re: nws-alerts sort issue
« Reply #8 on: January 26, 2017, 01:08:00 PM »
Also noticed this issue on my site as well.. Look forward to a fix soon.  Strange how it sorted -- seems like it was reverse from the array.