• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Delete album - missing "if" statement in album.php

Status
Not open for further replies.

Oakley

💖 Chevereto Fan
This applies to versions 3.10.2 to 3.10.5

When viewing the content within an album I've noticed that the red "Delete album" link (at the top of the page) still appears even if the "Enable user content delete" option is set to disabled.

zVi.jpg


This seems to happen because there appears to be an if statement missing from album.php

Basically, in views/album.php from line 29

PHP:
                <?php
                    if(is_owner() or is_admin()) {
                ?>
                <div class="breadcrum-item">
                    <a class="edit-link" data-modal="edit"><span class="icon-edit"></span><span><?php _se('Edit album details'); ?></span></a>
                </div>
                <div class="breadcrum-item">
                    <a class="delete-link" data-confirm="<?php _se("Do you really want to delete this album and all of its images? This can't be undone."); ?>" data-submit-fn="CHV.fn.submit_resource_delete" data-ajax-deferred="CHV.fn.complete_resource_delete" data-ajax-url="<?php echo G\get_base_url("json"); ?>"><?php _se('Delete album'); ?></a>
                </div>
                <?php
                    }
                ?>

Should probably be something like:

PHP:
				<?php
					if(is_owner() or is_admin()) {
				?>
				<div class="breadcrum-item">
					<a class="edit-link" data-modal="edit"><span class="icon-edit"></span><span><?php _se('Edit album details'); ?></span></a>
				</div>
				<?php
						if(is_allowed_to_delete_content()) {
				?>
				<div class="breadcrum-item">
					<a class="delete-link" data-confirm="<?php _se("Do you really want to delete this album and all of its images? This can't be undone."); ?>" data-submit-fn="CHV.fn.submit_resource_delete" data-ajax-deferred="CHV.fn.complete_resource_delete" data-ajax-url="<?php echo G\get_base_url("json"); ?>"><?php _se('Delete album'); ?></a>
				</div>
				<?php
						}
					}
				?>

The corresponding image.php file and the relevant tpl files all seem fine.
 
Status
Not open for further replies.
Back
Top