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

Compact helper - Allow scalar types to be assigned regardless of content #739

Conversation

circulon
Copy link
Contributor

@circulon circulon commented Dec 20, 2022

This PR fixes the issue where strings that contain the same content could not be assigned to multiple variables when using compact().

example:
This will throw the error "Cannot contain variables with multiple of the same object in scope"
Due to data2 and data3 having the exact same string content

        data1 = {"item1": 10}
        data2 = json.dumps([])
        data3 = json.dumps([])

        return self.view.render(
            "path.to.index",
            compact(data1, data2, data3),
        )

This PR also fixes the issue when passing a dict that the keys of the dict will be added as individual items and not the actual dict as expected.

@circulon circulon changed the title Allaow strings to be assigned regardless of content Compact helper - Allow strings to be assigned regardless of content Dec 21, 2022
@circulon circulon changed the title Compact helper - Allow strings to be assigned regardless of content Compact helper - Allow scalar types to be assigned regardless of content Jan 27, 2023
@josephmancuso josephmancuso merged commit 7329822 into MasoniteFramework:4.0 Sep 26, 2023
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