Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

Silverstripe 3.1 bug/error PHP Unit tests.


Go to End
Reply


3 Posts   463 Views

Avatar
Schippie

Community Member, 38 Posts

14 September 2013 at 4:22am

I am having an issue and i cannot seem to find the cause immediately. I am trying to push data into the member class. Through a YML file in a test case. The result is an error saying that it was expecting a string but received an array.

The error occurs at: framework/dev/fixtureblueprint line 248

protected function parseValue($value, $fixtures = null) {
		if(substr($value,0,2) == '=>') {

Where obvious array is not a string.

YML file looks something like:

Member:
     member1:
          FirstName: Foo
          Surname: Foo2
     member2: 
           FirstName: Test
           Surname: Test2

Now when going through the code i find that it grabs member2 and treats it as if it is a row below member1 aka it sees the yml as:

Member: 
    member1:
        FirstName: Foo
        Surname: Foo2
        member2: array()

My question now being what would cause this or is it simply an fairly unclear indicator that data is missing/incorrect/does not match a database column

Avatar
(deleted)

Community Member, 473 Posts

14 September 2013 at 9:38am

member2 is indented more than member1, thus is treated as a property of it.

Avatar
Schippie

Community Member, 38 Posts

14 September 2013 at 11:07am

Jup tried it, so stupid should have done what the configuration apparently said use 2 spaces not tabs like i am used to.
Though that seriously needs a better error :P