Mediatricks
Forum Replies Created
-
Same issue experienced by EDITOR level users on my site. (No issue for Admins)
On updating a page with ACF Meta field boxes:
“Updating failed. Sorry, you are not allowed to edit the _elementor_page_settings custom field.”Using ACF regular (6.3.12) and Elementor (3.27.6) Elementor Pro (3.27.5)
Discovered that under ELEMENTOR->ROLE MANAGER sub menu, if I enable the “Access to edit content only” check box for the EDITOR role, it fixes the problem.Previously I had “No access to editor” set for EDITORs as I didn’t really want them accessing the Elementor pages at all. But this seems to unlock the ability for ACF to give EDITORS permission to update the custom fields created by ACF.
It’s not a perfect fix and highlights a possible root of the problem – Why are the ACF fields being treated as Elementor Content (_elementor_page_settings) by WP when they don’t need to be. They should be recognized as meta data not Elementor data and user permissions should be applied accordingly.
- This reply was modified 1 year, 3 months ago by Mediatricks.
Tested and confirmed fixed. Thank you.
I would still like to request that the error messages on Ajax Fail are made more Customer friendly.
βNot going to fall for it!β is not a message our clients should see in case of error.
πI think another issue might be connected:
Too often, when a user is trying to register a payment and chooses to alter the PAYMENT AMOUNT from the top of their invoice they get an error “Not going to fall for it!”
This message alone drives my client crazy so I have manually updated in in _Controller.php to “Something went wrong!” but is seems to be linked to a similar Status / Nonce check issue.if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST[‘change_status_nonce’] ) ) , self::NONCE ) ) {
self::ajax_fail( ‘Something went wrong!’ ); }
BOTH ISSUES SEEM TO BE CREATED FROM WITHIN THIS FUNCTION:public static function maybe_change_status() { if ( ! current_user_can( 'edit_posts' ) ) { self::ajax_fail( 'Unauthorized User Action' ); } if ( ! isset( $_REQUEST['change_status_nonce'] ) ) { self::ajax_fail( 'Forget something?' ); } if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['change_status_nonce'] ) ) , self::NONCE ) ) { self::ajax_fail( 'Something went wrong!' ); } if ( ! isset( $_REQUEST['id'] ) ) { self::ajax_fail( 'Forget something?' ); } if ( ! isset( $_REQUEST['status'] ) ) { self::ajax_fail( 'Forget something?' ); } $view = ''; $doc_id = sanitize_text_field( wp_unslash( $_REQUEST['id'] ) ); $new_status = sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ); switch ( get_post_type( $doc_id ) ) { case SI_Invoice::POST_TYPE: $doc = SI_Invoice::get_instance( $doc_id ); $doc->set_status( $new_status ); $view = self::load_view_to_string( 'admin/sections/invoice-status-change-drop', array( 'id' => $doc_id, 'status' => $doc->get_status(), ), false ); break; case SI_Estimate::POST_TYPE: switch ( $new_status ) { case 'accept': $new_status = SI_Estimate::STATUS_APPROVED; break; case 'decline': $new_status = SI_Estimate::STATUS_DECLINED; break; default: break; } $doc = SI_Estimate::get_instance( $doc_id ); $doc->set_status( $new_status ); $view = self::load_view_to_string( 'admin/sections/estimate-status-change-drop', array( 'id' => $doc_id, 'status' => $doc->get_status(), ), false ); break; default: self::ajax_fail( 'Not an estimate or invoice.' ); return; break; } // action do_action( 'doc_status_changed', $doc, $_REQUEST ); header( 'Content-type: application/json' ); if ( self::DEBUG ) { header( 'Access-Control-Allow-Origin: *' ); } echo wp_json_encode( array( 'new_button' => $view ) ); exit(); }- This reply was modified 1 year, 4 months ago by Mediatricks. Reason: Update
Thank you. I have tested on my sandbox with a clean install of the latest version of the pro plugin, and NO other plugins active (using native 2024 WP theme) and the error persists.
Waiting on a fix.
Forum: Plugins
In reply to: [The Events Calendar] Cannot add Price to EventsThanks so much for confirming this. It was driving me mad. Will be patient for a fix.
Forum: Plugins
In reply to: [The Events Calendar] Cannot add Price to EventsI have the same problem since 5.7.1 update. Price does not get saved (or displayed) if the GUTENBERG BLOCK EDITOR is enabled for editing. If I turn off the Block Editor then I can set, and save price.
Forum: Plugins
In reply to: [StageShow] Custom Gateway Ticket Emails not sending since 8.0.3 updateSo you want to add a transaction ID even before the transaction is marked as COMPLETE?
This is doable? You can update the UpdateSaleReserved function from Step 2 above as follows:
————
// Update Set a Booking to RESERVED
function UpdateSaleReserved($saleId)
{$txnid = substr(md5(microtime()),rand(0,26),16);
date_default_timezone_set(βAsia/Kuwaitβ);
$date = new DateTime(βNOWβ);
$date->add(new DateInterval(βP90Dβ));
$newcheckout=$date->format(βY-m-d H:i:sβ);$sql = βUPDATE β.$this->DBTables->Sales;
$sql .= β SET saleCheckoutTime=ββ.$newcheckout.’β, saleTxnId=ββ.$txnid.’β, saleStatus=βReservedββ;
$sql .= β WHERE saleID=ββ.$saleid.’ββ;$this->query($sql);
// Get the SaleId and return it β¦.
$sql = βSELECT saleID FROM β.$this->DBTables->Sales;
$sql .= β WHERE saleID=ββ.$saleid.’ββ;$saleEntry = $this->get_results($sql);
if (count($saleEntry) == 0)
return 0;return $saleEntry[0]->saleId;
}———–
This should add a transaction ID into the Sales Table as a booking is put ON HOLD.
Forum: Plugins
In reply to: [StageShow] Custom Gateway Ticket Emails not sending since 8.0.3 updateHi Chris,
In the Sales Table I have added the option to put the reservation on hold for those situations when a customer starts a booking but then has a problem, or asks to add seats before completing payment, or wants to pay offline/cash.
I have added code hack so if a Reserved Booking is manually Confirmed in the back end, the DB is updated with a Sale Reference and the Paid Amount.
1.
In include/stageshow_sales_table.phpLook for
const BULKACTION_COMPLETED = ‘completed’;And add underneath:
—————
const BULKACTION_RESERVED = ‘reserved’;
—————
2. In include/stageshowlib_sales_dbase_api.phpAdd these two functions above the function GetSaleFromTxnID()
—————
//Update PAID on SET COMPLETE from Admin
function UpdateSalePaid($saleid)
{// Get the SaleId and return it ….
$sql = ‘SELECT saleID, SUM(ticketPaid) as invTotal FROM ‘.$this->DBTables->Orders;
$sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;$Totals = $this->get_results($sql);
$Paid= $Totals[0]->invTotal;
$txnid = substr(md5(microtime()),rand(0,26),16);$sql = ‘UPDATE ‘.$this->DBTables->Sales;
$sql .= ‘ SET salePaid=”‘.$Paid.'”, saleTxnId=”‘.$txnid.'”, salePPExpToken=””‘;
$sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;$this->query($sql);
// Get the SaleId and return it ….
$sql = ‘SELECT saleID FROM ‘.$this->DBTables->Sales;
$sql .= ‘ WHERE saleTxnId=”‘.$txnid.'”‘;$saleEntry = $this->get_results($sql);
if (count($saleEntry) == 0)
return 0;return $saleEntry[0]->saleId;
}// Update Set a Booking to RESERVED
function UpdateSaleReserved($saleId)
{date_default_timezone_set(‘Asia/Kuwait’);
$date = new DateTime(‘NOW’);
$date->add(new DateInterval(‘P90D’));
$newcheckout=$date->format(‘Y-m-d H:i:s’);$sql = ‘UPDATE ‘.$this->DBTables->Sales;
$sql .= ‘ SET saleCheckoutTime=”‘.$newcheckout.'”, saleStatus=”Reserved”‘;
$sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;$this->query($sql);
// Get the SaleId and return it ….
$sql = ‘SELECT saleID FROM ‘.$this->DBTables->Sales;
$sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;$saleEntry = $this->get_results($sql);
if (count($saleEntry) == 0)
return 0;return $saleEntry[0]->saleId;
}
—————3. In stageshowplus_sales_table.php
Look at about line 39 – 43 for the bulkAction for Set Complete and add this modified copy AFTER it (before the closing } of the function.
—————
if (!$editMode)
{
$this->bulkActions = array_merge($this->bulkActions, array(
self::BULKACTION_RESERVED => __(‘Hold Booking’, $this->myDomain),
));
}
—————4. In stageshowplus_manage_sales.php
Look around Line 142 for Bulk Action for COMPLETED and add the following after the break; (Line 147?)
—————case StageShowWPOrgSalesAdminListClass::BULKACTION_RESERVED:
if ($actionCount > 0)
$actionMsg = $actionCount . ‘ ‘ . _n(“Sale has been put on hold”, “Sales have been put on hold”, $actionCount, $this->myDomain);
else
$actionMsg = __(“Nothing to Update”, $this->myDomain);
break;—————
5. In stageshow_manage_sales.php
Look for the DoBulkAction function at the bottom of the file and replace it with this:
—————
function DoBulkAction($bulkAction, $recordId)
{
switch ($bulkAction)
{
case StageShowWPOrgSalesAdminListClass::BULKACTION_COMPLETED:
$saleResults = $this->myDBaseObj->GetSale($recordId);
$saleEntry = $saleResults[0];// Check record can be changed to COMPLETED
$prevSaleStatus = $saleEntry->saleStatus;// Get the sale entry
if (!$this->CanChangeState($prevSaleStatus, PAYMENT_API_SALESTATUS_COMPLETED))
return false;//HACK To Update Resered and Transaction Data
$this->myDBaseObj->UpdateSalePaid($recordId);
$this->myDBaseObj->UpdateSaleIDStatus($recordId, PAYMENT_API_SALESTATUS_COMPLETED);if ($prevSaleStatus == PAYMENT_API_SALESTATUS_RESERVED || $prevSaleStatus == PAYMENT_API_SALESTATUS_CHECKOUT)
{
// Previously Unverified Sale is confirmed – Send EMail to Purchaser
$this->myDBaseObj->EMailSale($saleEntry->saleID);
}
return true;case StageShowWPOrgSalesAdminListClass::BULKACTION_RESERVED:
$saleResults = $this->myDBaseObj->GetSale($recordId);
$saleEntry = $saleResults[0];// Check record can be changed to COMPLETED
$prevSaleStatus = $saleEntry->saleStatus;// Get the sale entry
//if (!$this->CanChangeState($prevSaleStatus, PAYMENT_API_SALESTATUS_COMPLETED))
// return false;// //HACK Change saleStatus to RESERVED
$this->myDBaseObj->UpdateSaleIDStatus($recordId, PAYMENT_API_SALESTATUS_RESERVED);
if ($prevSaleStatus == PAYMENT_API_SALESTATUS_UNVERIFIED || $prevSaleStatus == PAYMENT_API_SALESTATUS_CHECKOUT)
{// Previously Unverified OR CHECKOUT Sale is confirmed – Send EMail to Purchaser
$this->myDBaseObj->UpdateSaleReserved($recordId);
}
return true;
}return parent::DoBulkAction($bulkAction, $recordId);
}—————
(That will leave two } } before the closing php tag. )
That should do it (unless I missed a file) and you will be able to switch records between COMPLETED and ON HOLD (Reserved) in the back end sales table.
Forum: Plugins
In reply to: [StageShow] Custom Gateway Ticket Emails not sending since 8.0.3 updateAggghgh! I am an idiot! The include file was calling /stageshowgold/ folder and the new plugin is just /stageshow/ .
Sorry to bother you. But please consider adding these two features:
1. ID column in the Sales Table
2. The ability to change a sale from Checkout to Reserved. It is very useful for Backoffice management or putting seats on hold for customers who will pay offline. I have added it as a BulkAction in the Sales Table.π
Having the same problem. http://doublea.studio. Descriptions do not break at words/spaces which is very annoying.
- This reply was modified 8 years ago by Mediatricks.
Forum: Plugins
In reply to: [StageShow] Pending sales showing as salesI agree. Regularly curse that my quick tally of sales income was inaccurate as I hadn’t deleted pending sales.
Forum: Plugins
In reply to: [Easy Invitation Codes] [Plugin: BAW Easy Invitation Codes] Using with WP-MSAre you using Buddypress? If so, check out this variation?
http://mediatricks.com/2012/09/buddypress-version-of-baw-easy-invitation-codes-plugin/
I loved Julio’s original plugin but needed it to work on BP too so made a BP specific version you can get here: http://mediatricks.com/2012/09/buddypress-version-of-baw-easy-invitation-codes-plugin/
Forum: Fixing WordPress
In reply to: Media Uploader WP 2.5 – Caption and DescriptionYou can use the caption and description information neatly in plugins like Viva Zoom http://www.mediatricks.biz/zoom that uses HS to pop out your image and show the extra info.
Forum: Fixing WordPress
In reply to: Renaming Uncategorized creates duplicate Drafts/PostsI just did a complete fresh install with WP 2.5.1 (as my previous sites had just upgraded from 2.5) and this problem appears straight away – without renaming the Uncategorized category.
I think this is a bugin WP 2.5.1
Tim