magento2 – How to add upload image in custom payment gateway ( Magento 2.3.5)

**enter image description here**

I’m very new to magento, This is what is tried to achieve, an image uploader in custom checkout.

But the problem is I have no idea how to upload the image.

the code below is what I had tried.

I have no idea how the UploaderFactory model work,

I realised

$uploader = $this->_fileUploaderFactory->create((‘fileId’ => ‘image’));

doesn’t get any files from my input component in form html.

I have not confident what I do in correct path.

please help, thanks a lot.

Debug log message:
(2020-06-04 11:39:33) main.DEBUG: $_FILES array is empty {“exception”:”(object) (DomainException(code: 0): $_FILES array is empty at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/File/Uploader.php:573)”} ()

Most of my code is refer : https://github.com/mageplaza/magento-2-sample-payment-method
And I like to modify it to upload image. Upload text field already worked, but image upload drove me crazy.

Please help!

My template payment form html.

<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div
    class="payment-method"
    enctype="multipart/form-data"
    data-bind="css: {'_active': (getCode() == isChecked())}"
>
    <div class="payment-method-title field choice">
        <input
            type="radio"
            name="payment(method)"
            class="radio"
            data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"
        />
        <label class="label" data-bind="attr: {'for': getCode()}">
            <span data-bind="text: getTitle()"></span>
        </label>
    </div>

    <div class="payment-method-content">
        <!-- ko foreach: getRegion('messages') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <div class="payment-method-billing-address">
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

        <div class="field required">
            <label data-bind="attr: {for: getCode() + '_amount'}" class="label">
                <span> <!-- ko i18n: 'Amount'--><!-- /ko --> </span>
            </label>

            <div>
                <input
                    name="payment(amount)"
                    class="input-text"
                    type="number"
                    min="0.00"
                    step="0.01"
                    data-bind="
                                valueUpdate: 'keyup',
                                value: amount,
                                attr: {
                                        name: 'amount',
                                        placeholder: 'Transfered amount',
                                        'aria-describedby': 'noticeId',
                                        id: 'uid',
                                        disabled: false
                                    }"
                />
            </div>
        </div>

        <div class="field image">
            <label
                data-bind="attr: {for: getCode() + '_receiptimage'}"
                class="label"
            >
                <span> <!-- ko i18n: 'Bank Receipt Image'--><!-- /ko --> </span>
            </label>

            <div class="control">
                <input
                    type="file"
                    name="image"
                    id="image"
                    accept="*"
                    multiple="multiple"
                    data-bind="event: {change: receiptImageUpload},
                                attr:{
                                    name: 'image'
                                }"
                />
            </div>
        </div>

        <div class="actions-toolbar">
            <div class="primary">
                <button
                    class="action primary checkout"
                    type="submit"
                    data-bind="
                        click: placeOrder,
                        attr: {title: $t('Place Order')}
                        "
                >
                    <span data-bind="i18n: 'Place Order'"></span>
                </button>
            </div>
        </div>
    </div>
</div>

event.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="payment_method_assign_data">
    <observer name="bank_transfer_with_form_payment_gateway_data_assign" instance="MarslabBankTransferWithFormPaymentGatewayObserverDataAssignObserver" />
</event>

my observer
DataAssignObserver.php

    <?php

/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace MarslabBankTransferWithFormPaymentGatewayObserver;

use MagentoFrameworkEventObserver;
use MagentoPaymentObserverAbstractDataAssignObserver;

use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkAppFilesystemDirectoryList;
use MagentoFrameworkFilesystem;

class DataAssignObserver extends AbstractDataAssignObserver implements ObserverInterface
{
    protected $_logger;

    /**
     * @param Observer $observer
     * @return void
     */

    /**
     * File Uploader factory.
     *
     * @var MagentoMediaStorageModelFileUploaderFactory
     */
    protected $_fileUploaderFactory;

    protected $_mediaDirectory;

    /**
     * @param Filesystem                                       $filesystem,
     * @param MagentoMediaStorageModelFileUploaderFactory $fileUploaderFactory
     */

    public function __construct(
        Filesystem $filesystem,
        PsrLogLoggerInterface $logger,
        MagentoMediaStorageModelFileUploaderFactory $fileUploaderFactory
    ) {
        $this->_logger = $logger;
        $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
        $this->_fileUploaderFactory = $fileUploaderFactory;
    }

    public function execute(Observer $observer)
    {
        try {
            $method = $this->readMethodArgument($observer);
            $data = $this->readDataArgument($observer);

            $paymentInfo = $method->getInfoInstance();
            $this->_logger->debug("testing");

            $paymentInfo->setAdditionalInformation(
                'amount',
                $data->getDataByKey('additional_data')('amount')
            );

            $target = $this->_mediaDirectory->getAbsolutePath('customimage/image/');

            $this->_logger->debug($target);

            /** @var $uploader MagentoMediaStorageModelFileUploader */
            $uploader = $this->_fileUploaderFactory->create(
                ('fileId' => 'image')
            );
            $this->_logger->debug(" ('fileId' => 'image')");
            $uploader->setAllowedExtensions(
                ('jpg', 'jpeg', 'gif', 'png')
            );
            $uploader->setAllowRenameFiles(true);

            $resul = $uploader->save($target);

            $this->_logger->debug($resul);
        } catch (Exception $e) {
            $this->_logger->debug($e);
            return '';
        }

        return $this;
    } 
}

Throwing There was a problem reaching this app when hosting a custom Microsoft Teams app

I’m trying to host a custom teams tab application to my organization’s team and when I try to add the application I’m thrown with “There was a problem reaching this app” error. I’ve tried with both App studio as well as directly through a teams channel. The app was generated using yeoman app generator for teams. Does anybody have an idea of as to why this is happening? (All the permissions are set properly).
enter image description here

child theme – Need Help For Realia Real Estate plugin with CMB2, added custom field using function.php showing to backend but not in frontend

add_action( 'cmb2_meta_boxes', 'custom_fields' );

function custom_fields( array $metaboxes ) {
    $metaboxes(REALIA_PROPERTY_PREFIX . 'general')('fields')() = array(
        'id'    => REALIA_PROPERTY_PREFIX . 'custom_field33',
        'name'  => 'Field title',
        'type'  => 'text','position' => 2,

        'show_names'    => true,
        'on_front' => true,
    );

    return $metaboxes;
}

Trying to define a custom Composite to the new Unity Input System but failing somewhere

I’m following the “Touch Samples” sample project that comes with the “input system” package.

In one of the sample scene, there is a script that defines a custom composite Binding (for example the 2D vector composite).

I’m practically rewriting the same scripts except changing some inputs to be added to the composite, but it’s throwing me these errors, and since I’m relatively new to writing code don’t know how to begin solving the issue. The manual and the scripting API are no help either.

these are the errors
enter image description here

this is the example Script that adds a custom composite.


using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.Utilities;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace InputSamples.Drawing
{
    /// <summary>
    /// Simple object to contain information for drag inputs.
    /// </summary>
    public struct PointerInput
    {


        public bool Contact;

        /// <summary>
        /// ID of input type.
        /// </summary>
        public int InputId;

        /// <summary>
        /// Position of draw input.
        /// </summary>
        public Vector2 Position;

        /// <summary>
        /// Orientation of draw input pen.
        /// </summary>
        public Vector2? Tilt;

        /// <summary>
        /// Pressure of draw input.
        /// </summary>
        public float? Pressure;

        /// <summary>
        /// Radius of draw input.
        /// </summary>
        public Vector2? Radius;

        /// <summary>
        /// Twist of draw input.
        /// </summary>
        public float? Twist;
    }

    // What we do in PointerInputManager is to simply create a separate action for each input we need for PointerInput.
    // This here shows a possible alternative that sources all inputs as a single value using a composite. Has pros
    // and cons. Biggest pro is that all the controls actuate together and deliver one input value.
    //
    // NOTE: In PointerControls, we are binding mouse and pen separately from touch. If we didn't care about multitouch,
    //       we wouldn't have to to that but could rather just bind `<Pointer>/position` etc. However, to source each touch
    //       as its own separate PointerInput source, we need to have multiple PointerInputComposites.
    #if UNITY_EDITOR
    (InitializeOnLoad)
    #endif
    public class PointerInputComposite : InputBindingComposite<PointerInput>
    {
        (InputControl(layout = "Button"))
        public int contact;

        (InputControl(layout = "Vector2"))
        public int position;

        (InputControl(layout = "Vector2"))
        public int tilt;

        (InputControl(layout = "Vector2"))
        public int radius;

        (InputControl(layout = "Axis"))
        public int pressure;

        (InputControl(layout = "Axis"))
        public int twist;

        (InputControl(layout = "Integer"))
        public int inputId;

        public override PointerInput ReadValue(ref InputBindingCompositeContext context)
        {
            var contact = context.ReadValueAsButton(this.contact);
            var pointerId = context.ReadValue<int>(inputId);
            var pressure = context.ReadValue<float>(this.pressure);
            var radius = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.radius);
            var tilt = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.tilt);
            var position = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.position);
            var twist = context.ReadValue<float>(this.twist);


            return new PointerInput
            {
                Contact = contact,
                InputId = pointerId,
                Position = position,
                Tilt = tilt != default ? tilt : (Vector2?)null,
                Pressure = pressure > 0 ? pressure : (float?)null,
                Radius = radius.sqrMagnitude > 0 ? radius : (Vector2?)null,
                Twist = twist > 0 ? twist : (float?)null,
            };
        }

        #if UNITY_EDITOR
        static PointerInputComposite()
        {
            Register();
        }

        #endif

        (RuntimeInitializeOnLoadMethod)
        private static void Register()
        {
            InputSystem.RegisterBindingComposite<PointerInputComposite>();
        }
    }
}


and this is my code for my custom composite:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.InputSystem.Layouts;
#if UNITY_EDITOR
using UnityEditor;
#endif


public struct myPointerInput
{
    public bool Press;
    public int PressCount;
    public Vector2 Position;
    public Vector2 Delta;
    public Vector2? Radius;

    //touch specific
    public bool? Tap;
    //public UnityEngine.InputSystem.TouchPhase? phase;
    public Vector2? StartPosition;
    public float? StartTime;

    //mouse Specific
    public Vector2? Scroll;
}




#if UNITY_EDITOR
(InitializeOnLoad)
#endif
public class MyPointerInput : InputBindingComposite<myPointerInput>
{
    (InputControl(layout = "Button"))
    public int press;
    (InputControl(layout = "Integer"))
    public int pressCount;
    (InputControl(layout = "Vector2"))
    public int position;
    (InputControl(layout = "Vector2"))
    public int delta;
    (InputControl(layout = "Vector2"))
    public int radius;

    //touch specific
    (InputControl(layout = "Button"))
    public int tap;
    //(InputControl(layout = "TouchPhase"))
    //public UnityEngine.InputSystem.TouchPhase phase;
    (InputControl(layout = "Vector2"))
    public int startPosition;
    (InputControl(layout = "Double"))
    public int startTime;

    //mouse Specific
    (InputControl(layout = "Vector2"))
    public int scroll;



    public override myPointerInput ReadValue(ref InputBindingCompositeContext context)
    {
        var press = context.ReadValueAsButton(this.press);
        var pressCount = context.ReadValue<int>(this.pressCount);
        var position = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.position);
        var delta = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.delta);
        var radius = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.radius);

        var tap = context.ReadValueAsButton(this.tap);
        //var phase = context.ReadValue<UnityEngine.InputSystem.TouchPhase>(this.phase);
        var startPosition = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.startPosition);
        var startTime = context.ReadValue<float>(this.startTime);

        var scroll = context.ReadValue<Vector2, Vector2MagnitudeComparer>(this.scroll);



        return new myPointerInput
        {
            Press = press,
            PressCount = pressCount,
            Position = position,
            Delta = delta,
            Radius = radius.sqrMagnitude > 0 ? radius : (Vector2?)null,
            //Tap = tap,
            StartPosition = startPosition,
            StartTime = startTime,
            Scroll = scroll
        };
    }

#if UNITY_EDITOR
    static MyPointerInput()
    {
        Register();
    }
#endif

    (RuntimeInitializeOnLoadMethod)
    private static void Register()
    {
        InputSystem.RegisterBindingComposite<myPointerInput>();
    }


}


these are the errors in Text form:

ArgumentException: Don't know how to convert PrimitiveValue to 'Object'
Parameter name: type
UnityEngine.InputSystem.Utilities.PrimitiveValue.ConvertTo (System.TypeCode type) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Utilities/PrimitiveValue.cs:227)
UnityEngine.InputSystem.Utilities.NamedValue.ConvertTo (System.TypeCode type) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Utilities/NamedValue.cs:28)
UnityEngine.InputSystem.Editor.Lists.ParameterListView.Initialize (System.Type registeredType, UnityEngine.InputSystem.Utilities.ReadOnlyArray`1(TValue) existingParameters) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/ParameterListView.cs:146)
UnityEngine.InputSystem.Editor.InputBindingPropertiesView.InitializeCompositeProperties () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs:194)
UnityEngine.InputSystem.Editor.InputBindingPropertiesView.DrawGeneralProperties () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs:69)
UnityEngine.InputSystem.Editor.PropertiesViewBase.DrawGeneralGroup () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:59)
UnityEngine.InputSystem.Editor.PropertiesViewBase.OnGUI () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:39)
UnityEngine.InputSystem.Editor.InputActionEditorWindow.DrawPropertiesColumn (System.Single width) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:699)
UnityEngine.InputSystem.Editor.InputActionEditorWindow.OnGUI () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:637)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object() parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object() parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object() parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.DockArea.OldOnGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)  
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)  
  ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <817eebdd70f8402280b9cb11fff8b976>:0)
UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption() options) (at <817eebdd70f8402280b9cb11fff8b976>:0)
UnityEngine.GUILayoutUtility.GetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption() options) (at <817eebdd70f8402280b9cb11fff8b976>:0)
UnityEditor.EditorGUILayout.GetControlRect (System.Boolean hasLabel, System.Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption() options) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.EditorGUILayout.Popup (UnityEngine.GUIContent label, System.Int32 selectedIndex, UnityEngine.GUIContent() displayedOptions, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption() options) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.EditorGUILayout.Popup (UnityEngine.GUIContent label, System.Int32 selectedIndex, UnityEngine.GUIContent() displayedOptions, UnityEngine.GUILayoutOption() options) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEngine.InputSystem.Editor.InputBindingPropertiesView.DrawGeneralProperties () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputBindingPropertiesView.cs:72)
UnityEngine.InputSystem.Editor.PropertiesViewBase.DrawGeneralGroup () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:59)
UnityEngine.InputSystem.Editor.PropertiesViewBase.OnGUI () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:39)
UnityEngine.InputSystem.Editor.InputActionEditorWindow.DrawPropertiesColumn (System.Single width) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:699)
UnityEngine.InputSystem.Editor.InputActionEditorWindow.OnGUI () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:637)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object() parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object() parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object() parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEditor.DockArea.OldOnGUI () (at <78f1ad0f25c84e3ca853e639f50d95f5>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <3736d7cfd1f845a5922f99478cb469e7>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <817eebdd70f8402280b9cb11fff8b976>:0)

custom field – How do I create a directory of searchable pdf documents

I am working on a site that has a resources pages that will contain all official documents. I have used the WP File Download from https://www.joomunited.com/wordpress-products/wp-file-download but I want something more interactive that can offer advanced search features and filters.

Here’s an example of what I wanted to achieve.

an example of what I wanted

Could anyone point to a resource that will be helpful to create such?

Hide/show a custom block in Drupal 8

I have created a custom block of id downloadourapp and I would like to show/hide it base on certain statements.

I have create my custom module along with .module file where the code should be, however, I failed to find the right function to be used for that matter.

is hook_block_view_alter is the right function and how to hide or show this downloadourapp specific block.

terminal – How to automate folder action on macOS with custom script everytime a file is saved

Whenever I download any file – document, images, or any formats I want to remove all the metadata associated in that file. Currently, I do it by manually running in Terminal “xattr -rc XXXXXX file name with path”. This is time-consuming and I want to automate this by using any clever method which should automate this action at the background whenever a file is saved for example in Download folder on my macOS. When I right-click a folder in Finder on macOS there is a folder action where you can choose some default macOS .scrpt but I can not edit or write my own. Please advise some quick and robust way to handle this requirement. Many thanks.

sharepoint online – Copy custom list items from one list to another using CSOM

I found the following code from https://www.sharepointsky.com/sharepoint-online-copy-items-from-one-list-to-another-list-using-csom-net-managed-object-model-code/ to copy custom list items from one list to another:-

public static void CopyItemsFromOneListToAnotherList()
{

using (ClientContext ctx = new ClientContext(“https://onlysharepoint2013.sharepoint.com/sites/Bhawana/”))
{
ctx.AuthenticationMode = ClientAuthenticationMode.Default;
ctx.Credentials = new SharePointOnlineCredentials(GetSPOAccountName(), GetSPOSecureStringPassword());
ctx.Load(ctx.Web);
ctx.ExecuteQuery();

List sourceList= ctx.Web.Lists.GetByTitle(“SourceList”);
ctx.Load(sourceList);
ctx.ExecuteQuery();

List destList = ctx.Web.Lists.GetByTitle(“DestinationList”);
ctx.Load(sourceList);
ctx.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = “<View/>”;
ListItemCollection listItems = sourceList.GetItems(camlQuery);

ctx.Load(listItems);
ctx.ExecuteQuery();

foreach (ListItem item in listItems)
{
ListItemCreationInformation newItemInfo = new ListItemCreationInformation();
ListItem newItem = destList.AddItem(newItemInfo);
newItem(“Title”) = item(“Title”);
newItem(“EmailID”) = item(“EmailID”);
newItem(“Address”) = item(“Address”);
newItem.Update();
}
ctx.ExecuteQuery();
}
}

but i am not sure how i need to modify the CSOM code to copy the item versions as well?
Thanks

custom post types – How to add filter to post_name just for a CPT

I was seeing this post on how to add a filter that allows adding dots to post_name.

I made a change to use only dots.

I want to make it work only for one type of CPT.

But I don’t know how to check this in the admin.

I’m trying to add_action (‘admin_init’, ‘…’);

But when it passes through admin-ajax.php, it does not recognize the conditions to check the type of CPT.

See my code.

iis – Add custom domain on Azure without application restart?

Few months ago Azure started restarting applications when change occurs in custom domains. This behavior is, of course, quite bothersome as, aside of unnecessary restarts, startup on Azure can’t exactly be called swift. In my case I have two unrelated systems where few dozen domains point to single azure application with fixed IP address so restarts have negative influence on my mailbox.

I get same behavior in portal.azure.com and via powershell (Set-AzureWebsite -HostNames …) for top and sub domains, but wildcards are not causing restarts.

Is there some trick to get around this “feature”? Perhaps there is some magic hidden in powershell interface?