Unanticipated User Role setting causes error
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- authorization, backend
Hướng nghiên cứu
Bắt đầu trong CommentingPlugin::showComments và so sánh views/public/comments.php với views/public/commentingHeader.php được đề xuất. Theo dõi các kiểm tra vai trò để xem và thêm bình luận, sau đó xác minh rằng một vai trò được phép bình luận nhưng không được phép xem bình luận vẫn nhận được nhãn, thông báo flash và biểu mẫu bình luận mà không có lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I came across an issue which gets triggered by the scenario that a certain User Role is able to make a comment, but not allowed to view them. In this case the $view variable along with $view->addHelperPath is not set since this is currently dependent on the ability to view comments. Also in this scenario the Label as well as the flash message does not get output, since they currently reside in views/public/comments.php, which gets bypassed.
To fix the issue, I updated the showComments function in CommentingPlugin to the following:
public static function showComments($args = array())
{
echo "<div id='comments-container'>";
// presume we will need the view in any case
if(isset($args['view'])) {
$view = $args['view'];
} else {
$view = get_view();
}
$view->addHelperPath(COMMENTING_PLUGIN_DIR . '/helpers', 'Commenting_View_Helper_');
// output the header
echo $view->partial('commentingHeader.php');
if( (get_option('commenting_allow_public') == 1)
|| (get_option('commenting_allow_public_view') == 1)
|| is_allowed('Commenting_Comment', 'show') ) {
$options = array('threaded'=> get_option('commenting_threaded'), 'approved'=>true);
$comments = isset($args['comments']) ? $args['comments'] : $view->getComments($options);
echo $view->partial('comments.php', array('comments'=>$comments, 'threaded'=>$options['threaded']));
}
if( (get_option('commenting_allow_public') == 1)
|| is_allowed('Commenting_Comment', 'add') ) {
echo "<div id='comment-main-container'>";
echo $view->getCommentForm();
echo "</div>";
}
echo "</div>";
}
This presumes that we need the $views set in any case.
I also created a new file views/public/commentingHeader.php which contains:
<?php $label = get_option('commenting_comments_label'); ?>
<?php if ($label == ''):?>
<h2><?php echo __('Comments'); ?></h2>
<?php else: ?>
<h2><?php echo $label; ?></h2>
<?php endif; ?>
<div id='comments-flash'><?php echo flash(true); ?></div>
This code has been removed from views/public/comments.php.
- Ngôn ngữ chính
- PHP
- Star
- 4
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của omeka/plugin-Commenting
-
Rearrange configĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
omeka/plugin-Commenting#59 ·
-
Recaptcha link doesn't workĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
omeka/plugin-Commenting#58 ·
-
User role issuesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
omeka/plugin-Commenting#57 ·
-
Comment div bumps prev/next nav inappropriatelyCó thể làm lại được @patrickmj đã nhận 3165 ngày trước và không có pull request nào đang mở. Đang mở
omeka/plugin-Commenting#41 · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
omeka/plugin-Commenting#26 · 3 bình luận ·
Tất cả issue của omeka/plugin-Commenting
Issue tương tự
-
[Bug] : Main navigation "Upcoming Events" link navigates to /events/ without query parameterĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Area] REST API [Type] Documentation Good First Issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
WordPress/presence-api#584 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100