Comments (8)
Hey @guiguidoc, can you tell me where you're getting this error? What action are you performing?
from laravel-administrator.
When I access to the index page of a model
from laravel-administrator.
I'm looking into this at the moment. To give you an idea of where I'm coming from...I only ever tested this in MySQL! I'm actually really happy that you posted this here because I was curious to see what happens in postgresql. I'm going to try to set up a postgresql database today and isolate the issue.
from laravel-administrator.
Hey @guiguidoc. I've come up with a fix for this that should account for all possible scenarios. I couldn't cast the $id as an integer because sometimes people use non-integer values for ids. Instead, I changed the default $id value from boolean false (which PostgreSQL has an issue with) to integer 0. This should solve your issue, but please let me know if it hasn't. You can either grab the 2.3.0 source or make the changes from that commit directly (it's really simple...just a single line).
from laravel-administrator.
Hey janhartigan,
Thanks for the fix, Am now running your example app fine on pages Admin, Actors and Box office .
However i now get an error when viewing 'Films' and 'Theatre'
SQLSTATE[42883]: Undefined function: 7 ERROR: function format(numeric, integer) does not exist
LINE 1: ...films.film_id) AS num_actors, (SELECT CONCAT('$', FORMAT(SUM...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SQL: SELECT DISTINCT films.id, films.*, (SELECT CONCAT(directors.first_name, ' ', directors.last_name) FROM directors WHERE films.director_id = directors.id) AS director_name, (SELECT COUNT(actors_films.id) FROM actors_films WHERE films.id = actors_films.film_id) AS num_actors, (SELECT CONCAT('$', FORMAT(SUM(box_office.revenue), 2)) FROM box_office WHERE films.id = box_office.film_id) AS box_office FROM "films" GROUP BY "films"."id" ORDER BY "films"."id" DESC LIMIT 20 OFFSET 0
Bindings: array (
)
Let me know if you want a stack trace.
And, Thanks for your work on this bundle. Looks good.
from laravel-administrator.
Hey @kentvv. The examples use some MySQL functions (such as FORMAT) in the selects. If you're using PostgreSQL, you should give this a look: http://stackoverflow.com/questions/5419199/how-to-format-money-in-postgresql. So, for example, replace FORMAT on this line with to_char.
from laravel-administrator.
Perfect. Thanks for that.
from laravel-administrator.
Great...I'm glad that it worked. So now I sort of know that it works in PostgreSQL! Woot. You guys have really helped me out on this one :)
from laravel-administrator.
Related Issues (20)
- how to upload mp3 file and get its duration in laravel 4.2 HOT 1
- add persian (farsi) language
- Domain HOT 3
- WYSIWYG: disable remove class
- Laravel 5.3 Mysql Strict Compatibly Issue HOT 2
- Frozennode.com HOT 10
- edit_fields in type "relationship" doesn't work when foreign key is a non-primary key.
- Response::download not work in global action HOT 1
- error "MethodNotAllowedHttpException in RouteCollection.php line 218:" on laravel 5.3
- Add field type "array"
- How to change column value depending on selection of other field using relationship field
- Trying to change the value of uri in administartor.php returns InvalidArgumentException in UrlGenerator.php line 307: Route [admin_dashboard] not defined. HOT 2
- documentation HOT 1
- Laravel 5.4 support HOT 6
- File Download Dialog does not trigger in Chrome 57 HOT 4
- Master / Child form
- Pulling out of this project HOT 1
- can't register provider in config/app.php
- ERROR: Function name must be a string
- PHP 7.2.4 sizeof(): Parameter must be an array or an object that implements Countable HOT 2
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 laravel-administrator.