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

Server error in the segments panel #367

Closed
scandella opened this issue Feb 20, 2023 · 7 comments
Closed

Server error in the segments panel #367

scandella opened this issue Feb 20, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@scandella
Copy link
Contributor

Please provide a clear and concise description of what the bug is, including:

  • Steps to reproduce the issue.
    The following problem occurs only on my production server (some kind of database corruption?).

Create a "Regular" Segment
Add some conditions and save it.
Notice the "Sever error" message
The newly created segment does not appear in the segments list.
Althought, it appears in the contact panel and in the sendout panel.

  • A clear and concise description of what you expected to happen.
    All the "regular" segments should be correctly displayed in the segments panel
  • If applicable, add screenshots to help explain your problem.
    CleanShot 2023-02-20 at 23 51 18@2x
    CleanShot 2023-02-20 at 23 28 14@2x
    CleanShot 2023-02-20 at 23 39 54@2x
  • The plugin and Craft version numbers.
    Craft Pro 4.3.10
    Campaign 2.5.3
@scandella scandella added the bug Something isn't working label Feb 20, 2023
@bencroker
Copy link
Collaborator

Can you show me the segment edit screen please, so I can see what conditions are included?

@scandella
Copy link
Contributor Author

Hi Ben,
Unfortunately, I can’t show you the edit section of the saved segments, because they do not appear in the segments panel anymore after their saving.
But here is a picture of the kind of segment I’ve created.

Best,

CleanShot 2023-02-21 at 07 49 54@2x

@bencroker
Copy link
Collaborator

Thanks, that looks just fine. Can you please check the log files for the error stack trace, or email to [email protected]?

@scandella
Copy link
Contributor Author

Ben,
Here's the errors log. Is this what you need?
Seem to have a template error:
Next Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Unable to register extension "putyourlightson\campaign\twigextensions\CampaignTwigExtension" as extensions have already been initialized."). in /home/www/manufacture.scandella.fr/htdocs/vendor/craftcms/cms/src/templates/_layouts/base.twig:60

Best,
phperrors.log

@bencroker
Copy link
Collaborator

No, this looks unrelated. I'll need to see the latest web log file.

@scandella
Copy link
Contributor Author

OK, the web log file is there

Best,

@bencroker
Copy link
Collaborator

Thanks, here's the part I was looking for.

2023-02-21 06:56:47 [web.ERROR] [TypeError] craft\fields\conditions\OptionsFieldConditionRule::elementQueryParam(): Return value must be of type array, null returned {"trace":["#0 /home/www/manufacture.scandella.fr/htdocs/vendor/craftcms/cms/src/fields/conditions/FieldConditionRuleTrait.php(115): craft\\fields\\conditions\\OptionsFieldConditionRule->elementQueryParam()","#1 /home/www/manufacture.scandella.fr/htdocs/vendor/craftcms/cms/src/elements/conditions/ElementCondition.php(181): craft\\fields\\conditions\\OptionsFieldConditionRule->modifyQuery()","#2 /home/www/manufacture.scandella.fr/htdocs/vendor/putyourlightson/craft-campaign/src/services/SegmentsService.php(142): craft\\elements\\conditions\\ElementCondition->modifyQuery()"

This appears to be a bug in Craft, which I've submitted a fix for in craftcms/cms#12713. In the meantime you can avoid this by ensuring that the condition has at least one value selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants