• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • 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