To explain what this is about, first a short phpBB code history lesson: ;-)
r9823 originally introduced the usage of our template class for emails. The
messenger class uses set_custom_template() to initialise the template object
which neither disables storedb nor inheritance. These two values are set in
$user->theme rather than inside a particular template instance (quite a design
failure if I may add). Thus the html page that is displayed to the user also
determines these settings for the email templates. This obviously causes
problems because both emails and other custom templates can quite simply not
be stored in the database because the db table only stores the filename, not
the path and requires a template id.
r9839 then generally disabled storedb and template inheritance for custom
templates to fix Bug #40515. This works for custom templates, but not for
emails where lots of template objects are created. In such a situation the
last call to set(_custom)_template() would now determine the values of storedb
and inheritance in _tpl_load. So any page sending emails would neither load
its template from the database nor use template inheritance. The same revision
also introduced orig_tpl_* variables in set_template() which on their own are
very much pointless, but could allow resetting the storedb and inheritance
values if they were used to reset $user->theme just before template execution
in _tpl_load.
In r10150 these orig_tpl_* variables are correctly used to access information
about the template of the page being displayed - contrary to the last template
used - from within the bbcode, fixing Bug #51285. However r10150 also introduces
a pointless $template_mode parameter for set_custom_template(). $template_mode
is really just a boolean flag (value you can be 'template' or an arbitrary other
value) that if it set circumvents the unsetting of storedb and template
inheritance. The very code that had been added to prevent issues with emails and
custom templates. Fixing the problem introduced by r8839 but at the same time
reintroducing the much greater problem from the original implementation of email
templates.
And now an explanation of what I did:
Based on this I have now changed the set_custom_template method to always
disable storedb. It can now properly use inheritance, you simply tell it the
path where the parent template can be found, by default the path is false which
will turn inheritance off. To make this work the template class now always
overwrites $user->theme storedb and inheritance variabbles with orig_tpl_* just
before rendering a template in _tpl_load. This way they are guaranteed to always
contain the value they had at the time set_template/set_custom_template were
called. This fixes [Bug #54505].
In summary, using global state is simply a horrible idea in object oriented
programming. Always Pass values, that an object depends on, as parameters - never
through magic global variables. Following this principle will safe you from a lot
of headaches.
Please test this patch as much as possible to make sure templates still work
properly for you, focus on multiple languages, missing language files, and
custom templates in systems that make use of the template class outside of
phpBB itself.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10460 89ea8834-ac86-4346-8a33-228a782c2dd0
Fix Bug #53335
Fix wrong unique index fetch for oracle and sqlite
Fix alter column definition for firebird (although the query will fail in these circumstances [primary key] because firebird (again) does not support simple things... although... mssql/oracle having the same "problems", but there you are able to do more advanced queries)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10248 89ea8834-ac86-4346-8a33-228a782c2dd0
- fix index check for sqlite, firebird and oracle
- add check for unique index
- fix changing default value for column in mssql (add constraint)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10185 89ea8834-ac86-4346-8a33-228a782c2dd0
At the same time the database updater now supports checking for existing indexes. The db tools will not have this in 3.0.6 (the db tools have a function to retrieve all indexes) and i need to test the updater on all DBMS today...
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10183 89ea8834-ac86-4346-8a33-228a782c2dd0
- smaller memory footprint
- better checks for already updated files
- even less conflicts
- fixed automatic conflict resolving after successful merges
- no more conflicts for $Id$ changes
- fixed skip_whitespace_changes bug where code blocks were added to diff_op_add whereby the previous or next diff_op_copy already had the change
- correctly display merged files in diff view (previously it happened that the old file was used for comparision, although the new file was different/newer/merged)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10163 89ea8834-ac86-4346-8a33-228a782c2dd0
- link back to ACP main from send statistics
- improved language / better explanation (incl. Bug #48555)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9969 89ea8834-ac86-4346-8a33-228a782c2dd0
Generally, our config table is not really suited for holding large datasets. Because feed settings for the forums to enable news feeds and excluded forums rely on the forums itself we have decided to introduce a forum_options table where custom options can be stored.
Additionally, for this to work across all DBMS we support, we added a new method to the DBAL for the bitwise AND operator.
Also moved the forum/topic feed template variable to the location where they belong to (forum and topic view)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9965 89ea8834-ac86-4346-8a33-228a782c2dd0