DBTNG blog.module

EclipseGc - August 31, 2008 - 12:32
Project:Drupal
Version:7.x-dev
Component:blog.module
Category:task
Priority:normal
Assigned:Dave.Ingram
Status:closed
Issue tags:DBTNG Conversion, dc2009 code sprint
Description

OK, I think I've taken care of the necessary updates for now. Please review and let me know.

AttachmentSizeStatusTest resultOperations
blog.patch3.29 KBIdleFailed: Failed to apply patch.View details

#1

System Message - August 31, 2008 - 12:32

Patch failed to apply. More information can be found at http://testing.drupal.org/node/13930. If you need help with creating patches please look at http://drupal.org/patch/create

#2

EclipseGc - August 31, 2008 - 12:53

One more time

AttachmentSizeStatusTest resultOperations
blog.patch3.33 KBIdleFailed: Failed to apply patch.View details

#3

R.Muilwijk - August 31, 2008 - 13:04

Unfortunatly it breaks blog API tests. See the attached picture.

AttachmentSizeStatusTest resultOperations
tests.jpg87.63 KBIgnoredNoneNone

#4

R.Muilwijk - August 31, 2008 - 13:04
Status:needs review» needs work

#5

EclipseGc - August 31, 2008 - 13:17
Status:needs work» needs review

Actually BlogAPI appears to break w/ or w/o this code. Please verify. (also turn clean URLS on it'll run faster)

#6

R.Muilwijk - August 31, 2008 - 13:44

Hmmz this is strange. I just did a new checkout and all the tests passed. Then I applied your patch and it still passed :S

#7

R.Muilwijk - August 31, 2008 - 14:27

The dblog test is failing because of the function _blog_post_exists. You typecast a object to boolean here._blog_post_exists

#8

catch - September 1, 2008 - 08:52

BlogAPI weirdness was here, now passes in head: http://drupal.org/node/297860

(this is why all tests should always pass).

#9

Anonymous (not verified) - November 11, 2008 - 18:20
Status:needs review» needs work

The last submitted patch failed testing.

#10

Dave.Ingram - March 7, 2009 - 17:54
Title:Updating blog.module to be db tng compatible.» Updating blog.module to be DBTNG compatible.
Assigned to:EclipseGc» Dave.Ingram

Working on this as of the DrupalCon DC Code sprint... patch coming soon

#11

Dave Reid - March 7, 2009 - 17:55
Title:Updating blog.module to be DBTNG compatible.» DBTNG blog.module
Issue tags:+dc2009 code sprint

#12

Dave.Ingram - March 8, 2009 - 03:46

OK. So all db_query functions and their counterparts have been converted to the new dynamic db_select syntax throughout the module. As a part of this I also rewrote node_title_list() to use a foreach loop instead of a while loop, as suggested by Crell.

Additionally, two chunks of code in blog.pages.inc could be shortened by simply doing a fetchCol() on the query instead of fetching a result and then looping through the results.

AttachmentSizeStatusTest resultOperations
blog_dbtng_conversion.patch6.19 KBIdleFailed: 10750 passes, 50 fails, 12 exceptionsView details

#13

Crell - March 8, 2009 - 05:19

Do not use dynamic queries if you don't need dynamic behavior. It looks like you're converting all SELECT queries to dynamic, which is just a performance hit.

#14

Dave.Ingram - March 8, 2009 - 18:43

OK. What's the test for me to know which queries are dynamic and which are static?

#15

Crell - March 9, 2009 - 02:08

First try writing the query as a static. If you find that you need to use one of:

- String concatenation
- Paging
- Tablesort
- Node access restrictions

Then stop and make it dynamic instead.

That's not a perfect rule, but that's a good guideline. The vast majority of queries will be static.

#16

moshe weitzman - March 20, 2009 - 03:02

I would add to that ruleset: If you think there is a significant likelyhood that sites will want to alter the query to achieve custom needs, use db_select(). Static queries are not alterable.

#17

moshe weitzman - March 20, 2009 - 03:04

Also, if a query currently uses db_rewrite_sql() then you must include '->addTag('node_access')'. Thats missing in a few places.

#18

Berdir - April 13, 2009 - 20:01

Reroll.. there were no candicates for static queries, just added addTag() a few times and changed the extend() coding style according to #425872: DX problem with DB extenders. I also "removed" the node_title_list() change from the patch... I think it's easier to convert module per module.

AttachmentSizeStatusTest resultOperations
blog_dbtng_conversion2.patch5.45 KBIdleFailed: 10750 passes, 50 fails, 12 exceptionsView details

#19

Berdir - April 13, 2009 - 20:02
Status:needs work» needs review

#20

System Message - April 13, 2009 - 21:01
Status:needs review» needs work

The last submitted patch failed testing.

#21

Berdir - April 14, 2009 - 07:48

Patch chained a addExpression(1) call... replaced by fields('n', array('nid')).

AttachmentSizeStatusTest resultOperations
blog_dbtng_conversion3.patch5.46 KBIdlePassed: 10789 passes, 0 fails, 0 exceptionsView details

#22

Berdir - April 14, 2009 - 07:48
Status:needs work» needs review

#23

Dries - April 15, 2009 - 13:57
Status:needs review» fixed

Looks good, and all tests pass. Committed to CVS HEAD.

#24

System Message - April 29, 2009 - 14:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.