database – Rows are not deleting in the admin grid

class Delete extends MagentoBackendAppAction
{
/**
* @var WebkulGridModelGridFactory
*/
var $postFactory;

/**
 * @param MagentoBackendAppActionContext $context
 * @param WebkulGridModelGridFactory $gridFactory
 */
public function __construct(
    MagentoBackendAppActionContext $context,
    StathmosHelloWorldModelPostFactory $postFactory
) 
{
    parent::__construct($context);
    $this->postFactory = $postFactory;
}

/**
 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
 * @SuppressWarnings(PHPMD.NPathComplexity)
 */
public function execute()
{
    $data = $this->getRequest()->getPostValue();
    if (!$data) {
        $this->_redirect('stathmos_helloworld/post/index');
        return;
    }
    try {              

        $rowData = $this->postFactory->create();
              //  $rowData->addData($data)->save();

        $rowData->setData($data);
        // if (isset($data('id'))) {
        //     $rowData->setEntityId($data('id'));
        // }
        $rowData->delete();
        $this->messageManager->addSuccess(__('Row data has been successfully deleted.'));
    } catch (Exception $e) {
        $this->messageManager->addError(__($e->getMessage()));
    }
    $this->_redirect('stathmos_helloworld/post/index');
}

/**
 * @return bool
 */
protected function _isAllowed()
{
    return $this->_authorization->isAllowed('Stathmos_HelloWorld::delete');
}

}

namespace StathmosHelloWorldUiComponentListingPostColumn;

use MagentoFrameworkViewElementUiComponentContextInterface;
use MagentoFrameworkViewElementUiComponentFactory;
use MagentoUiComponentListingColumnsColumn;
use MagentoFrameworkUrlInterface;

class Action extends Column {

/** Url path */
const URL_PATH_EDIT = 'helloworld/post/edit';
const URL_PATH_DELETE = 'helloworld/post/delete';
const URL_PATH_VIEW = 'helloworld/post/view';

protected $actionUrlBuilder;
protected $urlBuilder;

public function __construct(
    ContextInterface $context, 
    UiComponentFactory $uiComponentFactory, 
    UrlInterface $urlBuilder, 
    array $components = (), 
    array $data = ()
) {
    $this->urlBuilder = $urlBuilder;
    parent::__construct($context, $uiComponentFactory, $components, $data);
}

public function prepareDataSource(array $dataSource) {
    if (isset($dataSource('data')('items'))) {
        foreach ($dataSource('data')('items') as & $item) {
            $name = $this->getData('name');
            if (isset($item('post_id'))) {
                $item($name)('edit') = (
                    'href' => $this->urlBuilder->getUrl(
                            self::URL_PATH_EDIT, (
                                'id' => $item('post_id')
                            )
                    ),
                    'label' => __('Edit')
                );
                $item($name)('delete') = (
                    'href' => $this->urlBuilder->getUrl(
                            self::URL_PATH_DELETE, (
                                'id' => $item('post_id')
                            )
                    ),
                    'label' => __('Delete'),
                    'confirm' => (
                        'title' => __('Delete "${ $.$data.title }"'),
                        'message' => __('Are you sure you wan't to delete a "${ $.$data.title }" record?')
                    )
                );
                $item($name)('preview') = (
                    'href' => $this->urlBuilder->getUrl(
                            self::URL_PATH_VIEW, (
                                'id' => $item('post_id')
                            )
                    ),
                    'label' => __('View')
                );
            }
        }
    }

    return $dataSource;
}

}

wordpress – Google Optimize for A/B test: Trying to edit existing HTML but says it’s over the limit even when I test deleting some of it?

I am trying to set up an A/B test of a company’s website for my project. There are certain changes I’d like to make such as changing the ‘favourites’ products on the home page to one with the top selling products which I was trying to do by substituting the existing code simply with the top selling products instead (i.e. their jpg, their links, their names etc).

However I found that when making ANY change (by selecting the element and clicking ‘edit HTML’), even testing it by deleting one character from the original code, that it then pops up with this error notification saying that it’s over the word limit. Even when I put the character back for example, the error message is still there. And it will say weirdly that it is quite a lot of the word limit even though it’s basically the original code! I then have to click cancel every time.

Please see the attached photo for reference (where I deleted one character from the original code to demonstrate how any editing (even deletion of original working code) then comes up with the error that the html is over the limit).

View post on imgur.com

Thanks in advance!

email – Would deleting a database also delete my e-mail box?

email – Would deleting a database also delete my e-mail box? – Software Engineering Stack Exchange

theming – Contact block are not displayed after deleting gz file, clearing all caches and adding a class to Twig tmpl

I’m a newbie with Drupal. I’ve tried to edit a CSS file. I’ve read that first I need to disable the option “Aggregate and compress CSS files”, then edit CSS file and then enable the option back. I did these steps, but then I removed existed gz version of the CSS file on the hosting. I also clicked the button “Clear all chaches” at the Perfomance tab and got the error like

Call to undefined method DrupalCoreFileFileSystem::scanDirectory()
in dfm_cache_flush() (line 92 of modules/dfm/dfm.module) …

Then I tried to add additional class to the div with the class="off-canvas-wrapper" in the file /themes/my_theme_name/templates/page.html.twig just to check whether I see than on the page and rewrite the file on the hosting. Since that moment the “Contact block” are not displyed on its page – just the heading “Contact block” instead of form fields. And I see in page source code that the html code is ended before the place where the form should be. I don’t know which of my actions caused that.

Common approach to get a node’s old value when modifying or deleting node in a graph?

My application contains a graph of nodes. When user modifies a node, the change may propagate to other nodes. For each nodes that are changed directly or indrectly, an event handler is triggered. The code in the event handler needs to access the node’s old property value (the value before its changed). I wonder what’s the typical and robust way to implement it?

A straightforward approach may be determining the nodes to be changed (both directly and indirectly) and sending an event, say, “willChange” to them to notiffy them to save current value. But that requires the app to determine ahead which nodes will be changed, which is specific to application logic. I didn’t try this approach.

My current approach is saving the entire graph before making change, then accessing the counterpart node in the backed graph to get old value, as below:

-> backup the entire graph
-> make change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph

This works, but has one limietaion. For example, the following doesn’t work because when we make the second change, the node value saved in the backed up graph is not up-to-date.

-> backup the entire graph
-> make a first change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph
-> make a second change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph

At first sight, the issue can be easily resolved by simply backing up the graph again before making the second change:

-> backup the entire graph
-> make a first change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph
-> backup the entire graph
-> make a second change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph

But it’s actually not that simple, because changes may be nested, like the following:

-> backup the entire graph
-> make a first change to the active graph
   -> event handler is triggered on a node
      -> retrieve the node's old value from the backed up graph
      -> make a second/nested change to the active graph
         -> event handler is triggered on a node
            -> retrieve the node's old value from the backed up graph

I resolve the issue in my current application with two approaches:

  1. Backup the entire graph again before the seond/nested change. This works. But backing up entire graph takes cpu time. So I suppose I should avoid doing this very often. Note that my application is event driven, so the event handler trigged in the second change may make a third change and this goes on.

  2. Design application code carefully to avoid the above nested call. This works, but it’s not a general solution and imposes restriction on how to design the code.

This is the first time I work on an application based on a graph of nodes. I didn’t have experience in this area before. I have made a long progress (the current application works fine) but I can’t help thinking if there is any better way to deal with the issue? I wonder what’s the common way to get a node’s old value when modifying or deleting node in a graph? Thanks.

Deleting CPT post by code (ie in a plugin) redirects to the main post type

  1. Suppose a CPT
  2. In functions.php or in a plugin, hook on ‘save_post’ to perform some
    calculations upon hitting the Publish button in WP-Admin…
  3. Inside the hook’s code include some conditional logic that under
    certain circumstances it will delete the CPT post that is just being
    created. Ie study the following piece of code:
add_action('save_post', 'import_external_data', 10, 2);
function import_external_data($post_id, $post)
{
    if ($post->post_status == 'publish' && $post->post_type == 'movie') {
        // Check if movie exists
        $movies = get_posts(array(
            'numberposts' => 1,
            'post_status' => 'publish',
            'post_type' => 'movie',
            'meta_key' => 'movie_id',
            'meta_value' => $post->post_content,
        ))(0);

        if (empty($movies)) {
            // Various actions take place here
        } else {
            wp_delete_post($post_id, true);
        }
    }
}
  1. Once the post is deleted you are redirected to the stock post type
    (?post_type=<CPT_slug> part of the URL is gone)

I already reported this in WordPress’s bug tracker, but I wonder if it’s really a bug or if I’m doing something wrong…

microsoft excel 2010 – Deleting Contents of Cells Depending on Value in a Combo Box

I have a spreadsheet that we are going to use as a “selector” tool to build out a custom part number depending on the chosen drop down options (concatenating the various values into one cell). For one model, I need to clear the contents of all of the rows under row 14 if the value in cell A13 = “Bare Pump” (not delete the data but clear the contents). To further complicate matters, I’m using a VLOOKUP to give me the abbreviated code for each drop down item and incorporating that into my concatenation. How do I clear the contents of the cell but keep the underlying VLOOKUP’s in place?

My SQL Trigger Seems to Never Fire When Deleting

CREATE OR REPLACE TRIGGER End
AFTER DELETE ON CONTRACT
FOR EACH ROW
BEGIN
    UPDATE TASK
    SET Count = Count - 1
    WHERE TaskID = :old.TaskID;
END;

The goal of this trigger is to fire when a user tries to delete one or more rows from the Contract Table. It will also update values of Count by -1 (the amount of current contracts per department) after they are deleted.

Contract Table Below

TaskID       WorkerID       Payment
3               222           600
3               432           660
3               001           805

Additionally, this is my Task Table

   TaskID               Name         Count
    1                Landscaping       0
    2                Maintenance       0
    3                   Misc           0

As is, I’m trying to develop test cases. If I do DELETE FROM Contract WHERE TaskID = 3, it deletes the 3 rows and Count reverts to 0 and my Contract Table becomes blank.

So I guess, I’m not sure this trigger is working. It never fires. It updates when I do delete statements, but it also says it needs to “fire when a user attempts to delete one or more rows from Contract.” Is it working as is? I get nothing firing. I think it’s working, it decreases Count by 1 when a worker is removed from the task, but it also deletes all 3 instances at once, in the prior example.

android 10 – Deleting App Data & Cache by a single app


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies 5000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Buy Cheap Private Proxies; Best Quality USA Private Proxies