Giter Site home page Giter Site logo

Comments (14)

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

I'm not sure, I've fully understood this. Can you provide an example of what is stored and what should be stored? Why is the DS non-existent?

from storage.

michael-e avatar michael-e commented on August 18, 2024

The issue seems to be with the 2.2.x branch only.

In S 2.2.5, the Datasource name is always Storage. An output parameter name will be built using dashes, like so:

    <ds-storage-cart>
        <item handle="item1">item1</item>
    </ds-storage-cart>

Now add $ds-storage-cart to the filter of a second datasource, and the auto-generated dependency will be:

$this->_dependencies = array('$ds-storage-cart');

This dependency can not be resolved, because there is no datasource with this name.

Symphony 2.3.:

I don't have a full-blown 2.3 installation, but some quick tests show that probably the issue does not exist. If you have a parameter like this:

    <ds-myfunny-storage.cart>
        <item handle="item1">item1</item>
    </ds-myfunny-storage.cart>

and add this to a datasource filter, the dependency will be:

$this->_dependencies = array('$ds-myfunny-storage.cart');

which seems to be resolved correctly. (Can you confirm this?)

from storage.

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

This dependency can not be resolved, because there is no datasource with this name.

So this is a Symphony bug: Symphony doesn't take data sources provided by extensions into account.

which seems to be resolved correctly. (Can you confirm this?)

I'll check that.

from storage.

michael-e avatar michael-e commented on August 18, 2024

No, it's not a Symphony bug. It's caused by the naming of the parameter. In the 2.2 example, if you manually change the dependency to be:

$this->_dependencies = array('$ds-storage');

it works!

So I think that this is a flaw in the 2.2.x branch of our extension which can not be solved easily. We might simply add it to the README.

from storage.

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

But doesn't hat mean, that we have to change the 2.2.x data source to only return a single output parameter for all groups, see https://github.com/hananils/storage/blob/2.2.x/data-sources/data.storage.php#L48-L50?

if(is_array($groups)) {
    $output = array();
    foreach($groups as $name => $values) {
        array_push($output, array_keys((array)$values));
    }
    $param_pool['ds-' . $this->dsParamROOTELEMENT] = $output;
}

(Haven't tested that.)

from storage.

michael-e avatar michael-e commented on August 18, 2024

That wouldn't help for filtering, because we would mix the items of all groups in a single parameter.

from storage.

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

But wouldn't that have the same result as renaming your DS manually.
I may be slow today though …

from storage.

michael-e avatar michael-e commented on August 18, 2024

You can not rename the Storage DS in the 2.2.x branch. But you can manually change the dependency in your second DS, so the the Storage DS will be executed first. Then filtering works with the parameters provided.

from storage.

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

Okay. In this case, I don't see a solution as it seems to be a system restriction that there can only be one output parameter per data source in 2.2.5.

from storage.

michael-e avatar michael-e commented on August 18, 2024

Yep, this is the reason that params with dots are not allowed in S 2.2, so we had to use dashes.

So we simply add this to the README, right?

from storage.

nilshoerrmann avatar nilshoerrmann commented on August 18, 2024

Seems to be the best option.
Everything else I can think of is hacking Symphony 2.2 and that doesn't make much sense.

from storage.

michael-e avatar michael-e commented on August 18, 2024

I will do it.

from storage.

michael-e avatar michael-e commented on August 18, 2024

Fixed by f2a7d93.

from storage.

michael-e avatar michael-e commented on August 18, 2024

I rebased the 2.2x branch and fixed a bug that I have introduced before. Your best bet is to delete your local version and clone the current repo.

I should always test my own stuff as well.
I should always test my own stuff as well.
I should always test my own stuff as well.
....

from storage.

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.