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 if styleSheetId cannot be retrieved #8

Open
wants to merge 8 commits into
base: r9_develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/Content/PageEditor/class.xudfPageObjectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ public function __construct(xudfContentGUI $parent_gui)
$tpl->parseCurrentBlock();

$tpl->setCurrentBlock("ContentStyle");
$style_id = $parent_gui->getObject()->getStyleSheetId();
if ($style_id == null) {
$style_id = 0;
}
Comment on lines +55 to +58
Copy link
Collaborator

Choose a reason for hiding this comment

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

From what I can see, $parent_gui->getObject()->getStyleSheetId() already defaults to 0 and never null.

See: ilObjStyleSheet::lookupObjectStyle

$tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
ilObjStyleSheet::getContentStylePath($parent_gui->getObject()->getStyleSheetId())
ilObjStyleSheet::getContentStylePath($style_id))
);
$tpl->parseCurrentBlock();
}
Expand Down