diff --git a/.travis.yml b/.travis.yml index 84f209b3dd32..bad7f18eb66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,10 +34,11 @@ install: # these providers require referencing git commit's which cause Travis to fail - sed -i '/mollie/d' composer.json - sed -i '/2checkout/d' composer.json + - sed -i '/omnipay-neteller/d' composer.json - travis_retry composer install --prefer-dist; before_script: - # prevent MySQL went away error + # prevent MySQL went away error - mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;' # copy configuration files - cp .env.example .env diff --git a/app/Http/routes.php b/app/Http/routes.php index 7ce979cfb06f..0e695c6fe52d 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -511,7 +511,7 @@ if (!defined('CONTACT_EMAIL')) { define('NINJA_GATEWAY_CONFIG', 'NINJA_GATEWAY_CONFIG'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); - define('NINJA_VERSION', '2.5.0.3'); + define('NINJA_VERSION', '2.5.0.4'); define('NINJA_DATE', '2000-01-01'); define('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'); @@ -683,4 +683,4 @@ if (Utils::isNinjaDev()) //ini_set('memory_limit','1024M'); //Auth::loginUsingId(1); } -*/ \ No newline at end of file +*/ diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index fbe1cb6a1c52..fcb210b0d7ad 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -281,7 +281,14 @@ class Utils } public static function getFromCache($id, $type) { - $data = Cache::get($type)->filter(function($item) use ($id) { + $cache = Cache::get($type); + + if ( ! $cache) { + static::logError("Cache for {$type} is not set"); + return null; + } + + $data = $cache->filter(function($item) use ($id) { return $item->id == $id; }); diff --git a/app/Listeners/SubscriptionListener.php b/app/Listeners/SubscriptionListener.php index 14d0bb0016c3..1098869c7748 100644 --- a/app/Listeners/SubscriptionListener.php +++ b/app/Listeners/SubscriptionListener.php @@ -1,25 +1,19 @@ account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer); } - public function createdQuote(QuoteWasCreated $event) { if ( ! Auth::check()) { return; } - $transformer = new InvoiceTransformer(Auth::user()->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); } - public function createdPayment(PaymentWasCreated $event) { if ( ! Auth::check()) { return; } - $transformer = new PaymentTransformer(Auth::user()->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]); } - public function createdCredit(CreditWasCreated $event) { if ( ! Auth::check()) { return; } - //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit); } - public function createdInvoice(InvoiceWasCreated $event) { if ( ! Auth::check()) { return; } - $transformer = new InvoiceTransformer(Auth::user()->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT); } - public function createdVendor(VendorWasCreated $event) { //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_VENDOR, $event->vendor); } - public function createdExpense(ExpenseWasCreated $event) { //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_EXPENSE, $event->expense); } - private function checkSubscriptions($activityTypeId, $entity, $transformer, $include = '') { $subscription = $entity->account->getSubscription($activityTypeId); - if ($subscription) { $manager = new Manager(); $manager->setSerializer(new ArraySerializer()); $manager->parseIncludes($include); - $resource = new Item($entity, $transformer, $entity->getEntityType()); $data = $manager->createData($resource)->toArray(); - // For legacy Zapier support if (isset($data['client_id'])) { $data['client_name'] = $entity->client->getDisplayName(); } - Utils::notifyZapier($subscription, $data); } } -} +} \ No newline at end of file diff --git a/database/seeds/PaymentLibrariesSeeder.php b/database/seeds/PaymentLibrariesSeeder.php index 654ad9fe0e43..b657e66dd1b9 100644 --- a/database/seeds/PaymentLibrariesSeeder.php +++ b/database/seeds/PaymentLibrariesSeeder.php @@ -1,5 +1,4 @@ 'BeanStream', 'provider' => 'BeanStream', 'payment_library_id' => 2], ['name' => 'Psigate', 'provider' => 'Psigate', 'payment_library_id' => 2], @@ -49,7 +46,6 @@ class PaymentLibrariesSeeder extends Seeder ['name' => 'WeChat Express', 'provider' => 'WeChat_Express', 'payment_library_id' => 1], ['name' => 'WePay', 'provider' => 'WePay', 'payment_library_id' => 1], ]; - foreach ($gateways as $gateway) { $record = Gateway::where('name', '=', $gateway['name'])->first(); if ($record) { @@ -59,6 +55,5 @@ class PaymentLibrariesSeeder extends Seeder Gateway::create($gateway); } } - } -} +} \ No newline at end of file