• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Implemented Category Option: Item Image Required

Bob

Developer
Staff member
As per title, there is a new Category Option "Item Image Required". This is a SUB Option to the existing Item Options: "Allow Items to be created" (as it only applies to the create process).

Default is ENABLED, so you will need to disable this for all your categories that you don't want to force this on.

Selection_672.png


When the "Item Image Required" is enabled and you try to create an Item without an IMAGE attachment, it will throw an error message.

Selection_673.png
 
Upvote 1
This suggestion has been implemented. Votes are no longer accepted.
IMPORTANT DEVELOPER NOTE: The Item DataWriter has some CHANGES that effect INSERTS.

There is a CONSTANT (const DATA_REQUIRE_ITEM_IMAGE) that is used to set a TRUE or FALSE on (default is TRUE if nothing is passed in).

This is used during the create item process to tell the DataWriter to check during Pre Save whether or not the Item contains an uploaded IMAGE. Here is an example of how I am using it (passed in before Pre Save().
PHP:
$writer->setExtraData(NFLJ_Showcase_DataWriter_Item::DATA_REQUIRE_ITEM_IMAGE, $category['item_image_required']);


There is another CONSTANT (const OPTION_ENFORCE_REQUIRE_ITEM_IMAGE) this is used to set a TRUE or FALSE on (default is TRUE is nothing is passed in).

This is used in situations where an image might be required, but you don't want to force it because of IMPORTING or CONVERTING or other types of DYNAMIC Item creation (from RSS Feeds). This will override the PreSave check allowing the item to be created without an image even when the category requires it.
PHP:
$itemDW->setOption(NFLJ_Showcase_DataWriter_Item::OPTION_ENFORCE_REQUIRE_ITEM_IMAGE, false);


If you have Addons that deal with Item Creation, you should probably let your Developer(s) know about this!
 
Back
Top