By Developers, For Developers

Historical errata for Grails 2: A Quick-Start Guide

PDF PgPaper PgTypeDescriptionFixed onComments
319TYPO

The session store defined in the SecurityFilter is `session.username`, but in the controller they reference `session.user` resulting in an endless loop of attempted logins as the filter will never be fulfilled.

89ERROR

When you merge the Venue and City together to form the Location, you never remove the Venue li block.

91TYPO

Figure 27 is wrong. It shows the Name

  • but you just walked us through removing that

  • and pulled it up into the

  • 3054TYPO

    I have the kindle book so 3054 is a location not a page.
    Passim in Chapter 7 re Forum.
    I have GGTS 3.5.0, Groovy 2.2
    Maybe this is a version thing, but it seems that in a lot of places where you refer to tekmessage’s “index”, you really mean “list”.
    For instance, shouldn’t
    def index(Integer max)…
    be
    def list(Index max)…?
    Also, I don’t have …tekMessage/index.gsp, but I do have a
    tekMessage/list.gsp.

    4588ERROR

    I could not get the Searchable plugin to work until I added the line for the mavenRepo to the repositories section BuildConfig.groovy as described in the Installation instructions of the plugin documentation. Fortunately, you had a link to the Searchable plugin documentation page so it was a relatively easy fix. I’m using the Kindle version, so the location is 4588 of 5588.

    101ERROR

    things.2/TekDays/grails-app/views/task/show.gsp

    with this condition
    We never see: “Completed No”

    ?ERROR

    Read from SafariBooks Online so pages were irrelevant. Chapter: 7, Section: Of Templates and Ajax

    The second section of code related to “forum.2/TekDays/grails-app/views/tekMessage/ajaxIndex.gsp”, specifically the “Message Details” h3 heading.

    Currently:

    Message Details

    Should be?:

    Message Details

    This will make the formatting compatible with main.css file reference after this section. Otherwise the Message Details heading on the page never is indented as displayed in Figure 34.

    ?TYPO

    Read from SafariBooks Online so pages were irrelevant.

    Using Grails 2.4.4, the main.css path was not found were stated.

    First line of Appendix 1, Additional CSS Rules, has a path that refers to “TekDays/web-app/css/main.css”. I believe this path is supposed to to the assets’s area stylesheet.

    That main.css file you should append to is
    TekDays/grails-app/assets/stylesheets/main.css

    ?SUGGEST

    Read on SafariBooks Online, so no page number. Chapter: 6, Section: Integration Testing.

    In grails 2.4.4 could not get the example TaskServiceSpec integration test to complete. I believe the way to do this under this version of grails is the following code. After a little research, it appears the following is nearly equivalent to the originally provided example.

    package com.tekdays

    import grails.test.spock.IntegrationSpec

    class TaskServiceIntegrationSpec extends IntegrationSpec {
    \tdef taskService
    void “test addDefaultTasks”() {
    \t\tgiven: ‘task service’
    \t\t\tnew TekUser(fullName: ‘Tammy Tester’, userName:‘tester’ , email: ‘tester@test.com’, website:‘test.com’, bio: ‘A test person’).save()

    \t\t\twhen: “we pass an event to taskService.addDefaultTasks”
    \t\t\tdef e = new TekEvent(name: ‘Test Event’,
    \t\t\t\tcity: ‘TestCity, USA’,
    \t\t\t\tdescription: ‘Test Description’,
    \t\t\t\torganizer:TekUser.findByUserName(‘tester’),
    \t\t\t\tvenue:‘TestCenter’,
    \t\t\t\tstartDate:new Date(),
    \t\t\t\tendDate: new Date() + 1 )
    \t\t\ttaskService.addDefaultTasks(e)

    \t\tthen: “the event will have 6 default tasks”
    \t\t\te.tasks.size() == 6
    }
    }

    ?TYPO

    Chapter 9, Section “Adding the Dashboard Action”

    The DashboardController.groovy code is missing a an open bracket for the Map being used to find Tasks, in both the page view and the link to the code.

    Currently: def tasks = Task.findAllByEventAndCompleted(event, false, max:3, sort:‘dueDate’, order: ‘asc’])

    Should be: def tasks = Task.findAllByEventAndCompleted(event, false, [max:3, sort:‘dueDate’, order: ‘asc’])

    Line 21 of: media.pragprog.com/titles/dkgrails2/code/bigger.2/TekDays/grails-app/controllers/com/tekdays/DashboardController.groovy

    ?TYPO

    Neither PDF nor Paper, found in SafariBooks Online
    Chapter 10, Section “Search Using Dynamic Finder”, last paragraph before image. “In the followinbg figure,” should read “In the following figure,”.

    27ERROR

    $grails test-app unit: TekEvent

    is incorrect for Grails 3.0.7

    instead use:

    $grails test-app TekEvent

    126ERROR

    I was unable to get the SecurityFilter to work with “return false” as the last statement in the before filter in Grails 2.3.8. With that statement in place, when I hit the filter and that code was executed, the site would return no content. Upon changing to “return true” the site began to render as expected.

    Categories: