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

Implement default selection for directories_categorySimple #817

Open
wants to merge 2 commits into
base: 5.0
Choose a base branch
from

Conversation

Ben-Ho
Copy link
Contributor

@Ben-Ho Ben-Ho commented May 7, 2018

as this needs a category_id to work.

@Ben-Ho Ben-Ho self-assigned this May 7, 2018
@Ben-Ho Ben-Ho requested review from nsams, fraxachun and kaufmo May 7, 2018 12:24
@nsams
Copy link
Member

nsams commented May 7, 2018

don't access database in constuctor

@Ben-Ho
Copy link
Contributor Author

Ben-Ho commented May 18, 2018

@nsams added a check to the constructor.

The initial problem: if creating a component and than cancel the process (without saving a value for the allowBlank(false) category-select) results in an exception on rendering the component. It's also not possible to delete the defect component or edit anything else on the site.

@nsams
Copy link
Member

nsams commented May 18, 2018

kann der default wert nicht in der komponente gemacht werden wenn nix gespeichert ist?

@Ben-Ho
Copy link
Contributor Author

Ben-Ho commented May 18, 2018

eigentlich wäre besser, wenn einfach eine fehlermeldung gerendert wird. den eine zufällige liste an artikel ist whs nie was man will.

@nsams
Copy link
Member

nsams commented May 18, 2018

Ja, oder einfach gar keine artikel?

If component throws an exception it's not possible to delete this
in backend anymore or edit any other component in same paragraphs
component.
If component shows random articles superuser might not realise
configuration is wrong so better show noting
Its's possible to cancel component creation leaving directory_component_id
empty resulting in $itemDir object null. By only adding config
values on existing itemDir component renders "no entries found"
which should be an indicator for superuser that something is wrong.
@Ben-Ho
Copy link
Contributor Author

Ben-Ho commented May 18, 2018

hatte den selben gedanken auch gerade. Ist so angepasst. (und an einer weiteren stelle behoben)

foreach ($model->getRows($s) as $row) {
$itemIds[] = $row->item_id;
}
$select->where(new Kwf_Model_Select_Expr_Boolean(false));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besser: return null

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.

None yet

4 participants