Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with MySQL STRICT_TRANS_TABLE + removed some hardcoded urls, fixes #157 #158

Merged
merged 8 commits into from
Aug 31, 2014

Conversation

sdebacker
Copy link

No description provided.

Now when clicking on INVOICE NOW, we can reach first step of a new
invoice creation even with MySQL 5.6 default STRICT_TRANS_TABLE.
@hillelcoren
Copy link
Member

Thanks for submitting these changes.

A concern I have is although this fixes seeding it's likely there will be other issues. We may want to set all fields to nullable. Do you know if this is a common issue with Laravel/Eloquent?

@sdebacker
Copy link
Author

Yes, there are many other issues on creating rows where all fields are not filled. I'm modifying migrations to allow null or have a default value, see these 2 last commits : https://github.com/sdebacker/invoice-ninja/commits/master

@sdebacker
Copy link
Author

After that, I think issues #122 and #152 will be fixed.

Because sending an empty string to a integer column is not allowed with
MySQL in STRICT_TRANS_TABLE mode.
“Since PHP 5.3, it is possible to leave out the middle part of the
ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1
evaluates to TRUE, and expr3 otherwise.”
http://php.net/manual/en/language.operators.comparison.php
@sdebacker sdebacker changed the title Seeding ok with MySQL STRICT_TRANS_TABLE, fixes #157 Compatibility with MySQL STRICT_TRANS_TABLE + removed some hardcoded urls, fixes #157 Aug 26, 2014
@sdebacker
Copy link
Author

Now InvoiceNinja works well on my configuration with MySQL 5.6 STRICT. I also removed some hardcoded urls in templates and in routes.php.

@hillelcoren
Copy link
Member

Amazing, thanks again for contributing. I'll try to test out your changes later today and then merge.

I wasn't aware of the "? :" shortcut, that's handy. Also. some of the links were hard coded on purpose (ie, the email footers). I'll need to put these back.

@sdebacker
Copy link
Author

I'm happy my contribution can help the project. About the url in email views, is it part of the licence that the official url should stay in footer ? if not, I don't see why not use main url from config.

@hillelcoren
Copy link
Member

Most people who setup the site are using it to send their own invoices. I hardcoded the links so setting the SITE_URL wouldn't cause people to try to sign up on their servers.

It's not part of the license, you can make any changes you like as long as you leave the 'powered by...' footer.

hillelcoren added a commit that referenced this pull request Aug 31, 2014
Compatibility with MySQL STRICT_TRANS_TABLE + removed some hardcoded urls, fixes #157
@hillelcoren hillelcoren merged commit a2d65a7 into invoiceninja:master Aug 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants