Skip to main content
 

Tweet: Feedback for @BBCNews reporters: EU is not Brussel...

Feedback for @BBCNews reporters: EU is not Brussels and Berlin, it’s just as much London. Stop pretending we’re not in it.

 

Tweet: Tried to login to @LastPass and login to twitter i...

Tried to login to @LastPass and login to twitter in a tab. After 4 minutes still waiting on login submission. Wifi! My iPhone 4 is too slow

 

 

Tweet: Surely there is a tumblr for that?

Surely there is a tumblr for that?

 

Tweet: Dear ios dev team can you please make a badges cen...

Dear ios dev team can you please make a badges center so I don’t have to see these nagging red numbers all over my serene ios home screen?

 

Tweet: My Hide Trackbacks #wordpress plugin is now compat...

My Hide Trackbacks plugin is now compatible with version 4.1 (wordpress.org/plugins/hide-t…) Keep referrers, stop spam comments.

 

Tweet: Started a huffduffer feed (https://t.co/wax0BHeF2D...

Started a huffduffer feed (huffduffer.com/svandragt) to listen to audio files on the move using my podcast client.

 

Tweet: Are there any razor blades (single blades) that m...

Are there any razor blades (single blades) that meet @LeapingBunny cruelty free standards? Not been able to find any! :(

 

 

Tweet: 2014 for me was about the failure to have a honest...

2014 for me was about the failure to have a honest debate about . Today's recap on @BBCNews keeps adding spin / lies

 

Tweet: Python or poetry: pip install fabricfab deploysi...

Python or poetry: pip install fabric
fab deploy
sip lemonade

 

 

Tweet: #powershell tip: $ContentsWithLinebreaks = (Get-Co...

tip: $ContentsWithLinebreaks = (Get-Content $FilePath) -join "`n"

 

Tweet: Trying to figure out how to download all my past t...

Trying to figure out how to download all my past tweets using Twitter Tools for

 

Tweet: Made some layout changes ...

Made some layout changes to vandragt.com (refresh), any comments?

 

Set a webpart to use the full viewport height

Today I wrote a bit of code that will set a webpart to use up all available height in a SharePoint page.

  1. If required, convert the page to a Blank WebPart Page or any other type that allows multiple webparts.
  2. Add a Script Editor web part with the code below, changing the elementID passed into SvdSetElementFullHeight with your element's ID attribute.

http://gist.github.com/svandragt/cbbd138d15f61fb71df9/7d07c53a3dfaa011005b5158e09bcfdd98312099

 

 

 

Tweet: Amazingly thorough documentation example from @vis...

Amazingly thorough documentation example from @visualsvn: Upgrading to VisualSVN Server 3.2 visualsvn.com/support/topic/…

 

SilverStripe relation records management - or why do I have so many database records?

You have a bunch of DataObjects that has_many RelatedItems. You might have the following seperate situations:

  1. Get the Dataobject->RelatedItems() and remove() one RelatedItem. What happens to that RelatedItem?
  2. Delete() a DataObject. What happens to the RelatedItems for that DataObject?

Regarding 1: (in SilverStripe 3.0.x) - the DataObjectID for that RelatedItem is set to 0.

Regarding 2: Nothing, their DataObjectID will point to a non-existing record.

Wrong Expectations

In both cases I expected the objects to be deleted, but SilverStripe is going for safety first and keeps the records around just in case.

This means that you might need to write maintenance code if you don’t expect this happening.

Things to keep in mind

If you are writing an sync task and want to make sure RelatedItems are fresh, do not delete / remove RelatedItems before creating new ones. You will be creating thousands of records over time.

Instead, get the list of IDs, and unset the IDs that you find. Then remove any IDs left in the list as they weren’t in the source.