Coder Social home page Coder Social logo

think I found a bug with where("something", "somevalue") and where("something", "<>", "somevalue") about laravel-model-caching HOT 10 CLOSED

mikebronner avatar mikebronner commented on June 22, 2024
think I found a bug with where("something", "somevalue") and where("something", "<>", "somevalue")

from laravel-model-caching.

Comments (10)

mikebronner avatar mikebronner commented on June 22, 2024

Thanks @vesper8 ! I will look into that as soon as possible (I'm currently out of town and will return next week). It looks like I need to differentiate the where clauses better. Thanks so much for reporting this. :)

from laravel-model-caching.

vmosoti avatar vmosoti commented on June 22, 2024

seems like a bug when using where with other operators including <,>,<=,>=

from laravel-model-caching.

mikebronner avatar mikebronner commented on June 22, 2024

yea, that's my thinking as well

from laravel-model-caching.

vesper8 avatar vesper8 commented on June 22, 2024

this is a pretty dangerous bug that's easy to miss and can cause a lot of problems.. hope you can fix it soon :)

from laravel-model-caching.

mikebronner avatar mikebronner commented on June 22, 2024

Yea, sorry about the delay ... I have been out of the office most of the last month. Will try to get to it this week. :|

from laravel-model-caching.

mikebronner avatar mikebronner commented on June 22, 2024

@vesper8 Thanks for being patient. Can you verify that 0.2.19 fixes this issue? Thanks! :)

from laravel-model-caching.

vesper8 avatar vesper8 commented on June 22, 2024

@mikebronner thanks for making the changes!

I will check it out.. just as soon as I figure out the best way to merge your changes into my fork

But actually I would much prefer not to have to use my fork

Can you have a look at my two commits in my fork here
master...vesper8:master

And tell me if you would be willing to accept a pull request for these changes?

Basically I need these two changes to make your package compatible with Mongodb models

I am quite certain this does not break anything

from laravel-model-caching.

mikebronner avatar mikebronner commented on June 22, 2024

@vesper8 Ah yes, those are on the docket for review. Can you you submit those as a PR, then we can discuss them there? That would be awesome!

from laravel-model-caching.

vesper8 avatar vesper8 commented on June 22, 2024

@mikebronner I just made a PR for one of the changes

As for the other.. I'm confused.. I tried to "blame" on the CachedKey.php but I can't figure out in which commit you removed the line


$value .= "_" . array_get($where, 'value');

which is last shown in this commit e150f28

Since this is the line that I needed to follow up with

 if (is_array($value)) {
     $value = implode("_", $value);
 }

Which could be more elegantly adapted to

$value .= "_" . (
is_array(array_get($where, 'value')) ? implode("_", array_get($where, 'value')) : array_get($where, 'value'))

or maybe you can come up with something even nicer

from laravel-model-caching.

mikebronner avatar mikebronner commented on June 22, 2024

Hi @vesper8 , that line was removed a few releases ago. The functionality has been moved into the getValues (or similar, I'm not at my computer right now) method further down. I plan on redoing how the keys are built up anyway, so it likely won't matter anymore then.

from laravel-model-caching.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.