Advertisement:

Author Topic: Osclass Extreme Memory Usage with Multi-Country  (Read 6491 times)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #30 on: September 06, 2015, 03:06:35 pm »
Quote
What is totally clear is that osc_get_cities() -with no region parameter- never should be used unless (as in the case on that user-profile.php) already a View variable "cities" has been created.

This memory issue was bound to be related to something like this looking at the amount of countries Aficionado is using and imagining how many cities this will fetch....
I can even find it funny to be honest though the issue itself is not funny at all! ;D

We have to thank Aficionado for putting so many countries to the test making us aware of pitfalls that otherwise might slip through.


Regards,
Eric

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #31 on: September 07, 2015, 10:15:27 am »
@dev101
Your solution will fail in case osc_user_region_id() is empty, I think for unregistered user it is still empty.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2518
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #32 on: September 07, 2015, 11:18:55 am »
I think you're right Frosticek, in that case a pre-liminary check on region and a 'default' region would solve that or similar trick teseo used where population of (dropdown) fields is put on hold till user selects location data.

Actually what the 'issue' tells us developers is that we have to be 'smarter'/'offer better quality' with regard to usability in this case related to location input and what Osclass offers us. 8)

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2171
  • osclass.work
Re: Osclass Extreme Memory Usage with Multi-Country
« Reply #33 on: September 07, 2015, 12:24:17 pm »
@ frosticek
Yes, you are correct (I don't allow guests), but in that case js will not act until region is selected ;)