View Single Post
12-26-08, 09:14 AM   #166
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by saulhudson View Post
<text />
Most of the errors people see is because they update oUF before the layouts have been updated. This is probably due to there being a lot of confusion about layout compatibility between oUF releases.

The current versioning scheme is: a.b.c, and the current version is 1.3.1.
a - major version - this will probably never change, unless the entire layout system is replaced with something else.
b - minor version - acts as an indicator of what changes have been made to the API. This is changed when I make an internal change which will break with current layouts.
c - maintenance version - bug fixes made to the core, which are backward compatible with previous versions.

Based on this we've basically had three versions which have broken layouts since August 2008. In most cases it might not seem that a lot has happened on the back-end, but here's the diff stats between every minor version:
Code:
1.0 -> 1.1 (1146 lines diff)
 elements/aura.lua      |  109 +++++++++++++++++++---
 elements/castbar.lua   |  236 ++++++++++++++++++++++++++++++++++++++++++++++++
 elements/cpoints.lua   |   18 +++-
 elements/happiness.lua |   35 +++++---
 elements/health.lua    |  115 ++++++++++++++++--------
 elements/power.lua     |  131 +++++++++++++++++++++------
 elements/pvp.lua       |   26 ++++--
 elements/range.lua     |   11 ++-
 oUF.toc                |    3 +-
 ouf.lua                |  147 +++++++++++++++++++-----------
 10 files changed, 671 insertions(+), 160 deletions(-)

1.1 -> 1.2 (1301 lines diff)
 elements/aura.lua      |   16 ++++-
 elements/castbar.lua   |  180 +++++++++++++++++++++++++------------------
 elements/cpoints.lua   |    5 +
 elements/happiness.lua |   12 +++-
 elements/health.lua    |   39 +++++++--
 elements/leader.lua    |   14 +++-
 elements/portraits.lua |    5 +
 elements/power.lua     |   45 ++++++++---
 elements/pvp.lua       |    5 +
 elements/range.lua     |    6 +-
 elements/ricons.lua    |   12 +++-
 elements/status.lua    |    5 +
 elements/tags.lua      |  199 ++++++++++++++++++++++++++++++++++++++++++++++++
 elements/threat.lua    |   44 +++++++++++
 oUF.toc                |   18 +----
 oUF.xml                |   37 +++++++++
 ouf.lua                |  170 +++++++++++++++++++++++++----------------
 17 files changed, 630 insertions(+), 182 deletions(-)

1.2 -> 1.3 (2016 lines diff)
 elements/aura.lua      |  178 +++++++++++++------------------
 elements/castbar.lua   |  149 +++++++++++++++++++-------
 elements/cpoints.lua   |   34 +++---
 elements/happiness.lua |   25 +++--
 elements/health.lua    |   48 ++++++---
 elements/leader.lua    |   23 +++-
 elements/portraits.lua |   24 +++--
 elements/power.lua     |   93 +++++++++--------
 elements/pvp.lua       |   25 +++--
 elements/range.lua     |    6 +-
 elements/ricons.lua    |   20 +++-
 elements/status.lua    |   66 ++++++++----
 elements/tags.lua      |  274 ++++++++++++++++++++++++++++-------------------
 elements/threat.lua    |   30 ++++--
 elements/vehicle.lua   |   83 +++++++++++++++
 oUF.toc                |    4 +-
 oUF.xml                |    1 +
 ouf.lua                |  197 +++++++++++++++++++++--------------
 18 files changed, 796 insertions(+), 484 deletions(-)
It was probably especially bad with this release, as the event system and element system got a complete rewrite, while mostly maintaining "compatibility" with previous versions. In many cases you could just use oUF 1.3.x on a 1.2.x layout, without getting any errors, at least at first.

My guess is that many of the layout authors just have done some minor testing, and thought "hey, this works! *release*". The line 94 error that most people have at is an indicator of this being the case. It happens because people just registered events, assuming that the event handlers would always be in the oUF table. In 1.2 and earlier the elements just forced themselves into the core table, and acted as a event fallback for all oUF objects, while in 1.3 they are hidden away until registered on a object.

I wanted to get some error checking in before I made the 1.3 release, but in the end I had to make a choice between releasing 1.3 as is, or delaying it yet another week. I announced on the forum that I wanted to have it released by the 15th December, but that was delayed until 21st due to time restrictions.

Making a 1.2 layout work on 1.3 is quite easy in most cases actually. You can take a look at what changes I did on my layouts:
Classic:
http://ixo.no/git/oUF_Classic.git/co...62c98037a266e9
http://ixo.no/git/oUF_Classic.git/co...be91394ca9d272
http://ixo.no/git/oUF_Classic.git/co...9e39165a22b55c

Lily:
http://ixo.no/git/oUF_Lily.git/commi...faad45af8f74a9
http://ixo.no/git/oUF_Lily.git/commi...4dba74bac17ea5
http://ixo.no/git/oUF_Lily.git/commi...4e55397c071dae
http://ixo.no/git/oUF_Lily.git/commi...bc451794e6be28

Originally Posted by Mordog View Post
You have to change oUF and not the Layout.

Open oUF.lua and search for

Code:
-- Events
local OnEvent = function(self, event, ...)
	if(not self:IsShown() and not self.__unit) then return end
	self[event](self, event, ...)
end
change it to

Code:
-- Events
local OnEvent = function(self, event, ...)
	if(not self:IsShown() and not self.__unit) then return end
	if (self[event]) then
  self[event](self, event, ...)
else
  print(string.format('Object %s (%s) attempted to call event [%s], which has no handler.', tostring(self), tostring(self.unit), even))
end
end
That should fix the error
That's not a fix at all. It will only print a error when a layout is doing something wrong.