unanimously agreed to rollback the deletion API. We all support the
features this patch added, yet not its actual design and implementation.
After some talk, we decided that it would be better for Drupal -- in the
long term -- not to go with a solution that isn't 100%. We also recognize
that in the short term, this patch would have been useful addition. So
let's figure out how we can implement this properly in D7.
Note: properties, which are different in the RTL display are marked with /* LTR */ in default CSS files now,
so maintainers remember that changing them should also have an effect on RTL CSS files.
This should open the way for better RTL (right-to-left written) language (such as Arabic and Hebrew) support.
- #41897: Dead variable (remove_short)
- #39117: Fix chinese search problem
- Fix bug with and OR queries
- Add smarter highlighting for CJK strings
- Add message about minimum word length to user
- Improve code comments
TODO:
+ The contact.module was broken; a new patch for contact.module is needed.
+ Documentation is needed.
+ The most important modules need to be updated ASAP.
- Clean URLs: search/type/keywords e.g. "search/node/drupal release". The search
form is POST submitted, but drupal_gotos to a GET page. This makes it easy to
copy/paste search URLs, and makes the pager a lot cleaner.
- Remember the search keywords when switching between the search tabs. This is
done through the same GET URLs rather than the session, so it does not mess up
between multiple browser tabs.
- Report which keywords were ignored because they were too short.
- #820: Provide search block
- Treat multiple wildcards in a row as one
1) The different types of search, which used to be radio button options in the search form, are now subtabs of "search" (default "search/node"). This seems better from a UI point of view, but also has another advantage: modules which implement a custom search form (flexinode, project) can add it as a subtab of search. This means that all search forms will be located in the same place, and also without needing an extra api call to search.module.
2) The current code was a bit hackish, as the indexing of comments along with nodes was hardcoded in node.module. Instead, I created a nodeapi operation "update index" which allows modules to add more data for a node that is being indexed. Comments are now indexed using this mechanism and from comment.module, which is a lot cleaner.
3) The search results format was also hardcoded to include "N comments". I replaced this with a nodeapi operation "search result" and moved the comment code to comment.module where it belongs. This op is quite useful, as for example I also modified upload.module to add "N attachments" to a search result if any are present.
* Less logic in theme code.
* Encourages use of the menu system.
* Easier to find where a title or breadcrumb comes from in other people's code because there are less places to look. Look in menu and then grep for the appropriate set function. Looking for calls to theme_page() is hard because there are too many of them.
* Very slightly more efficient.
db_query($query, $a, $b, $c);
db_query($query, array($a, $b, $c));
This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.
However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.
This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.
I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.
Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);
and
- return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
+ return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);
I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.
This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query. This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself. With the new, documented syntax, there is no more excuse to put data directly in the query.
+ When a comment is posted, a node needs to be re-indexed. Luckily, we can use node_comment_statistics for this easily.
+ When a node is deleted, it should be deleted from the search index as well.
+ The search wipe didn't properly remove links to nodes from the index.
+ Section url was faulty in _help.
+ Minor code rearrangement.
+ Display 'friendly' name rather than module name in search watchdog
messages.
+ Remove left-over from search_total table.
+ Add index wipe button to the admin
+ Moved the admin to admin/settings/search
+ Prevented menu bug when node modules update the breadcrumb in view
(thanks JonBob).
+ Changed search_total table's word key to PRIMARY.
1) Clean up the text analyser: make it handle UTF-8 and all sorts of characters. The word splitter now does intelligent splitting into words and supports all Unicode characters. It has smart handling of acronyms, URLs, dates, ...
2) It now indexes the filtered output, which means it can take advantage of HTML tags. Meaningful tags (headers, strong, em, ...) are analysed and used to boost certain words scores. This has the side-effect of allowing the indexing of PHP nodes.
3) Link analyser for node links. The HTML analyser also checks for links. If they point to a node on the current site (handles path aliases) then the link's words are counted as part of the target node. This helps bring out commonly linked FAQs and answers to the top of the results.
4) Index comments along with the node. This means that the search can make a difference between a single node/comment about 'X' and a whole thread about 'X'. It also makes the search results much shorter and more relevant (before this patch, comments were even shown first).
5) We now keep track of total counts as well as a per item count for a word. This allows us to divide the word score by the total before adding up the scores for different words, and automatically makes noisewords have less influence than rare words. This dramatically improves the relevancy of multiword searches. This also makes the disadvantage of now using OR searching instead of AND searching less problematic.
6) Includes support for text preprocessors through a hook. This is required to index Chinese and Japanese, because these languages do not use spaces between words. An external utility can be used to split these into words through a simple wrapper module. Other uses could be spell checking (although it would have no UI).
7) Indexing is now regulated: only a certain amount of items will be indexed per cron run. This prevents PHP from running out of memory or timing out. This also makes the reindexing required for this patch automatic. I also added an index coverage estimate to the search admin screen.
8) Code cleanup! Moved all the search stuff from common.inc into search.module, rewired some hooks and simplified the functions used. The search form and results now also use valid XHTML and form_ functions. The search admin was moved from search/configure to admin/search for consistency.
9) Improved search output: we also show much more info per item: date, author, node type, amount of comments and a cool dynamic excerpt à la Google. The search form is now much more simpler and the help is only displayed as tips when no search results are found.
10) By moving all search logic to SQL, I was able to add a pager to the search results. This improves usability and performance dramatically.
CHANGES
-------
+ Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page.
+ Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'.
+ Grouped settings. All settings have been grouped under 'administer > settings'.
TODO
----
+ Update core themes: only Xtemplate default supports tabs and even those look ugly. Need help.
+ Update contributed modules. The menu() hook changed drastically. Updating your code adhere the new menu() function should be 90% of the work. Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
administrators will be able to define a custom 403 page, just as they
can define 404 pages now.
This needs to be documented in the "Changes since / migrating to ..."
pages.
* fixes all doxygen warnings [#]_ in the current code base
+ changes @param style from phpDocumentor (@param type $var desc) to doxygen (@param $var desc)
+ documents all undocumented parameters
+ escapes / fixes html warnings
+ fixes @defgroup in theme.inc
* adds more groupings [#]_
+ drupal_{set|get}_title, drupal_{set|get}_breadcrumb
+ pager.inc: pager_api (pager_query(), pager_display()), pager pieces
* adds a new group "themeable" which contains all themeable functions.
Phase 2 of the menu system integration project. This unifies the interface
used by admin and non-admin pages, and deprecates the _page hook in favor of
explicit callbacks from menu(). Breadcrumbs, titles, and help text go away
as a result of this patch; they will return in the phase 3 patch, printed
by the theme.
"The noise words description says that whitespace and line breaks will be
stripped out, but the code never does any trimming. This simple patch strips
the whitespace from the noise words. This probably takes care of bug #2804."
and the request will be terminated when something suspicious is
detected. This will be logged in the watchdog. With help from Marco.
- Fixed translation issue in the archive module. Patch by Gerhard.
- Removed dead parameter from variable_get(). Patch by Chris Johnson.
Fixes bug #2111.
- Improved input checking of taxonomy module. Patch by Gerhard.
Fixes bug #2112.
- Fixed a typo in the MSSQL database scheme. Patch by Michael Frankowski.
- Removed dependency on "register_globals = on"! Patches by Michael Frankowski.
Notes:
+ Updated the patches to use $foo["bar"] instead of $foo['bar'].
+ Updated the INSTALL and CHANGELOG files as well.
- Tiny improvement to the "./scripts/code-clean.sh" script.
- removed admin options for queue and comment module if the modules are not
loaded.
- nodes are now auto promoted when queue module isn't enabled.
- moderation result block is now visible by the node author.
- fixed comment flat list view missing 1 comment.
- changed update.php around a bit.
* security check isn't in effect if the db hasn't been updated.
* instructions re-organized.
* fixed some minor updates.
- updated database.mysql done by UnConeD.
- changelog update.
his sandbox) and fixed some typos in the module's comments.
* Moshe: what are the $wordlist changes you made? Mind to elaborate a
bit on those?
* TODO: validate the SQL queries used in the search module using a SQL
validator tool - I wonder whether they are ANSI compliant.
- // If the word is preceeded by a "+", then this word is required, and
+ // If the word is proceeded by a "+", then this word is required, and
- $inputword = ("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
- mysql_query($inputword);
+ db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
}
- // Zap the weighted words array, so we dont add multiples.
+ // Zap the weighted words array, so we don't add multiples.
+ Changed the db_query() API.
+ Wrapped all links in l(), lm(), la(), ..., drupal_url() functions.
+ XHTML-ified some HTML.
+ Wrapped a lot of text in the administrative pages in a t()
function.
+ Replaced all $REQUEST_URI/$PATH_INFOs by request_uri().
+ Small bugfixes (eg. bug in book_export_html() and clean-ups (eg.
RSS code).
+ Fixed some bugs in the taxonomy module (eg. tree making bug), added
new functionality (eg. new APIs for use by other modules), included
Moshe's taxonomy extensions, and some documentation udpates.
+ ...
for the meta system. The patches add some extra functionality to the
comment system (for example, comments can be set read-only) and fix a
couple of small problems.
+ I integrated the required SQL updates from the varius *.mysql files
into the "update.php" script. Upgrading should be easy ...
+ I did not apply/commit the "user.diff" as requested by Marco ...
+ I didn't know what to do with "forum.module" and "forum2.module":
what do you want me to do with it Marco? Which one should go in?
+ Can we remove "node_index()" now; both from "node.module" and the
themes?
+ Thanks Marco!
- added who is online block.
- made weblog module more configurable.
- users may now delete their own accounts (Feature #8)
- users may now request a password using email address *or* username.
formerly required both items to match an account which was onerous.
- the link to request a new password is now presented whenever a user
fails login.
- there is now a confirmation message after submitting edits to your
user information.
- error messages in user.module may now be stylized by themes.
- <hook>_form has a $param setting you can fill with form parameters.
- improved wording for a few config settings.
- fixed various non-coding standard things.
range of databases including MySQL, PostgreSQL, MSSQL, and others.
For additional information and an 'how to upgrade', check the mails
sent to the mailing list.
- fixed small glitch in comment_del()
- changed the API of the form() function. The first parameter, the
"action"-attribute in the <form>-tag has been made optional. By
default, it will be set to "$REQUEST_URI".
Why? Because in 98% of the cases we would do:
global $REQUEST_URI;
$form = form($REQUEST_URI, $form_content);
while we can do:
$form = form($form_content);
now.
Update your modules (and sorry for the inconvenience)!