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

Fix: change default value for metrics layout to be compatible with modals #2787

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

czernika
Copy link
Contributor

@czernika czernika commented Jan 8, 2024

This PR fixes error when using metrics and modals are presents at the same time (not within modal)

I will not open issue, basically steps to reproduce

  1. Install Orchid, go to users list, click on "edit email" modal - everything is OK
  2. Add dummy metric layout
public function query(): iterable
{
  return [
     // ...
     'metrics' => 1,
  ];
}

public function layout(): iterable
{
 // ...
 Layout::metrics(['Metrics' => 'metrics']),
}
  1. Click same button again - modal data was not loaded (we can see skeleton and 500 error in a console)

Proposed Changes

Default data for metrics currently is empty array so it is passes is_array() check within layouts/metric.blade.php (currently line 13) and expects value key to be present. This PR should fix it

@tabuna tabuna merged commit e0c7d9e into orchidsoftware:master Jan 10, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants