Comments (21)
Strange, I use phpunit, as laravel says, and no errors appear.
from closuretable.
I have two ClosureTable folders, one inside a laravel project that i update via composer to your repo, one in my documents folder, and in both cases i get the same errors.
htdocs: http://paste.laravel.com/WRv
documents: http://paste.laravel.com/WRw
OSX 10.7.5 / macbookpro
PHP version: 5.4.10 (MAMP)
PHPunit version: 3.7.27
Dependencies installed through composer (identical in both folders)
illuminate/container 4.0.x-dev ee86c89
illuminate/database 4.0.x-dev 64c9e48
illuminate/events 4.0.x-dev 2253c8c
illuminate/support 4.0.x-dev bec895e
nesbot/carbon 1.4.0 A simple API extension for DateTime.
If you need more info let me know!
from closuretable.
Updated php to 5.5.3, errors persist. I don't know where i should bang my head on. I'm going to setup a vm with vagrant to test on linux.
from closuretable.
I did further tests on a vm created with vagrant from this repo: https://github.com/bryannielsen/Laravel4-Vagrant and i still get all 34 errors: http://paste.laravel.com/WV4
from closuretable.
My setup is Mac OS X 10.7.5 and I don't use virtual machine. PHP is:
PHP 5.4.16 (cli) (built: Jun 15 2013 04:04:59)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans
PHPUnit 3.7.21 by Sebastian Bergmann.
from closuretable.
Line 544 is where $this->getKey() is called, hm...
from closuretable.
What makes me think is that before the last call to $this->prepareTestedSiblings()
, it stops on line 70, at the end of this:
$child = $page->appendChild(Page::make(array(
'title' => 'Child Page Test Title',
'excerpt' => 'Child Page Test Excerpt',
'content' => 'Child Page Test content',
'language' => 'en'
)), 0, true);
or on line 117, at the end of this:
$child1 = $page->appendChild(Page::make(array(
'title' => 'Test Title',
'excerpt' => 'Test Excerpt',
'content' => 'Test content',
'language' => 'en'
)), 0, true);
from closuretable.
Tried on Windows 7 32bit (MINGW32_NT-6.1) as well, PHP 5.5.4 (cli), PHPUnit 3.7.27, i still get all 34 errors:
http://paste.laravel.com/X44
from closuretable.
How have you sped, Andea?
from closuretable.
@franzose, nothing new at the moment, i tried to write other tests for prepareTestedSiblings()
but i always get the InvalidArgumentException. I am now studying a bit phpunit API to see if i can make it spit out a more detailed log, because 'Value must be provided' is not really helpful as hint. By the way, did you manage to see the errors in your phpunit?
from closuretable.
@vjandrea, and now, you wouldn't believe, I've got the same 34 errors! great. So, now it's a problem of both of us :D
from closuretable.
And I know the reason.
from closuretable.
@vjandrea, when we call Entity::make()
, it tries to guess and set the position if not provided by this: $model->guessPositionOnCreate();
. What do we see inside that method? Yes, we see $this->hasSiblings()
and $this->lastSibling()
calls. Exception is thrown right after $this->hasSiblings()
call because... The query is built by buildSiblingsQuery()
and buildSiblingsSubquery()
methods. The latter requires id
of the model. But the model doesn't have it yet because hasn't been saved into the database!
from closuretable.
We have to change somehow the way position
is guessed.
from closuretable.
Amazing! Now i know where i should bang my head on! I'm trying to figure out something.
from closuretable.
So, what if we put a check in hasSiblings()
that returns false if the id
is not set? I think we should avoid the creation of the query in that case.
from closuretable.
@vjandrea, I think that can break things. Now I'm trying to assume that when we make()
, we can set position
to 0 as well as the depth
. Part of errors are gone after that, but still there's 5.
from closuretable.
@franzose that's great! Do you mind pasting the error dump of the remaining 5, or create a hotfix branch with your edit that i can pull to test?
from closuretable.
@vjandrea, aaaaaaaaarrgghhhhhh! Sorry, but it's fucking great. I have solved problems with siblings at last! Sorry, but you'll need to update your repository and merge with your changes.
from closuretable.
Brilliant job, @franzose!
from closuretable.
@vjandrea thanks, however I suppose that there's still problem with the position
column. I will discover that a little later.
from closuretable.
Related Issues (20)
- Getting Descendant of Ancestor with Descendant in a single query HOT 1
- Compatibility with later Laravel versions (5.7, 5.8 and 6.x) HOT 5
- make command does not work with Laravel 6.2 HOT 3
- Collection::makeTree() hits database for each child HOT 4
- Upgrade guide to v6 HOT 2
- Examples from readme are not works HOT 2
- Child with multiple parents not possible (child will be moved) HOT 1
- Hardcoded table column names in the ClosureTable model
- Error: array_key_exists() expects parameter 2 to be array, int given HOT 1
- How get Tree from 0 level ? HOT 5
- Problem with createFromArray method HOT 2
- erro in delete member
- createFromArray
- ancestorsWithSelf() queries database for each ancestor
- Readme example doesnt work in 6.1.1 HOT 2
- Multiple parents HOT 1
- Deprecated interfaces in Entity and ClosureTable
- What should I do when my data volume is very large, more than 100 million? HOT 2
- reorderSiblings method doesn't update softdeleted node's position
- Seeking a method to not update updated_at
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from closuretable.