ExamGecko
Home Home / Adobe / AD0-E716

Adobe AD0-E716 Practice Test - Questions Answers, Page 4

Question list
Search
Search

List of questions

Search

Related questions











The developer is required to convert a modules database scripts from old install/upgrade setup files to a data patches format and does not want to apply database changes that were already done by install/upgrade scripts.

The current module version is 1.5.4.

What would be the recommended solution to skip changes that were already applied via old format (install/upgrade scripts)?

A.
Implement Patchversioninterface and return 1.5.4 on the getversion() method.
A.
Implement Patchversioninterface and return 1.5.4 on the getversion() method.
Answers
B.
Inside apply() method, check for module version and run the code if version is less than 1.5.4.
B.
Inside apply() method, check for module version and run the code if version is less than 1.5.4.
Answers
C.
This is not possible. A module cannot implement both data patch and install scripts.
C.
This is not possible. A module cannot implement both data patch and install scripts.
Answers
Suggested answer: A

Explanation:

According to the Develop data and schema patches guide for Magento 2 developers, data patches are classes that contain data modification instructions. They are defined in a <Vendor>/<Module_Name>/Setup/Patch/Data/<Patch_Name>.php file and implement MagentoFrameworkSetupPatchDataPatchInterface. Data patches can also implement Patchversioninterface to specify the module version that the patch is associated with. The getVersion() method returns the module version as a string. To skip changes that were already applied via old format (install/upgrade scripts), the developer should implement Patchversioninterface and return 1.5.4 on the getVersion() method. This way, the data patch will only be applied if the module version is greater than or equal to 1.5.4. Verified

Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/data-patches.html

An Adobe Commerce developer has created a module that adds a product attribute to all product types via a Data Patch-According to best practices, how would the developer ensure this product attribute is removed in the event that the module is uninstalled at a later date?

A.
Add an Uninstall.php file extending \l1agento\Framework\Setup\UninstallInterface tO the module's Setup directory and implement the uninstall method.
A.
Add an Uninstall.php file extending \l1agento\Framework\Setup\UninstallInterface tO the module's Setup directory and implement the uninstall method.
Answers
B.
Add instructions to the module's README.md file instructing merchants and developers that they must manually remove this attribute if they want to uninstall the module.
B.
Add instructions to the module's README.md file instructing merchants and developers that they must manually remove this attribute if they want to uninstall the module.
Answers
C.
Make the Data Patch implement \Magento\Framework\setup\Patch\PatchRevertabieinterface and implement the revert method to remove the product attribute.
C.
Make the Data Patch implement \Magento\Framework\setup\Patch\PatchRevertabieinterface and implement the revert method to remove the product attribute.
Answers
Suggested answer: C

Explanation:

According to the Develop data and schema patches guide for Magento 2 developers, data patches can also implement PatchRevertabieinterface to provide rollback functionality for their changes. The revert() method contains the instructions to undo the data modifications made by the patch. To ensure that the product attribute is removed when the module is uninstalled, the developer should make the data patch implement PatchRevertabieinterface and implement the revert method to remove the product attribute using EavSetupFactory or AttributeRepositoryInterface. Verified

Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/data-patches.html

An Adobe Commerce developer successfully added a new column to the customers grid. This column needs the data to be formatted before showing its content in the grid.

According to best practices, how would the developer add the custom logic to render the column?

A.
1- Create an after pluginforMagento\Ui\Component\Listing\Columns\Column::prepareColumn(). 2- Add the custom logic within the afterPreparecoiumn method.
A.
1- Create an after pluginforMagento\Ui\Component\Listing\Columns\Column::prepareColumn(). 2- Add the custom logic within the afterPreparecoiumn method.
Answers
B.
1- Create a custom class extending flagento\Ui\Component\Listing\Columns\Colunm. 2- Add the custom logic within the prepareDataSource method. 3- Add an attribute class to the column node within the module's customer_listing.xml.
B.
1- Create a custom class extending flagento\Ui\Component\Listing\Columns\Colunm. 2- Add the custom logic within the prepareDataSource method. 3- Add an attribute class to the column node within the module's customer_listing.xml.
Answers
C.
1- Override the Magento\Customer\Ui\Component\DataProvider Class using a preference. 2- Override the getData() method and add the custom logic per row.
C.
1- Override the Magento\Customer\Ui\Component\DataProvider Class using a preference. 2- Override the getData() method and add the custom logic per row.
Answers
Suggested answer: A

An integration named Marketing is created on the Adobe Commerce instance. The integration has access on Magento_Customer:: customer resources and the access token is xxxxxx.

How would the rest API be called to search the customers?

A.
Using the integration access token as Bearer: curl -X GET https://magentourl/rest/Vl/customers/search?searchCriteria... -H 'Authorization: Bearer XXXXXX'
A.
Using the integration access token as Bearer: curl -X GET https://magentourl/rest/Vl/customers/search?searchCriteria... -H 'Authorization: Bearer XXXXXX'
Answers
B.
Passing integration name and access token as http auth credentials: curl -X GET https ://Marketing:XXXXXX(Slmagentourl/rest/Vl/customers/search?5earchCriteria . . . Using integration name as username and access token as password, get the admin token (yyyyyy) via: curl -X POST https://magentourl/rest/Vl/integration/admin/token -d '{'username':'Marketing', 'password':'XXXXXX'}' -H 'Content-
B.
Passing integration name and access token as http auth credentials: curl -X GET https ://Marketing:XXXXXX(Slmagentourl/rest/Vl/customers/search?5earchCriteria . . . Using integration name as username and access token as password, get the admin token (yyyyyy) via: curl -X POST https://magentourl/rest/Vl/integration/admin/token -d '{'username':'Marketing', 'password':'XXXXXX'}' -H 'Content-
Answers
C.
Type: application/json' Use the admin token as Bearer curl -X GET https://magentourl/rest/Vl/customers/search?searchCriteria... -H 'Authorization: Bearer YYYYYY'
C.
Type: application/json' Use the admin token as Bearer curl -X GET https://magentourl/rest/Vl/customers/search?searchCriteria... -H 'Authorization: Bearer YYYYYY'
Answers
Suggested answer: B

Explanation:

According to the Magento Stack Exchange answer, UI components are used to render various elements on Magento admin pages, such as grids, forms, buttons, etc. UI components are defined in XML files that are located in the view/adminhtml/ui_component directory of each module. To add a custom logic to render a column in a grid, the developer should create a custom class extending MagentoUiComponentListingColumnsColumn and add the custom logic within the prepareDataSource method. This method receives an array of data sources and modifies them according to the column logic. The developer should also add an attribute class to the column node within the module's customer_listing.xml file and specify their custom class name as its value. Verified

Reference: https://magento.stackexchange.com/questions/317821/how-to-add-custom-logic-to-render-a-column-in-a-grid-in-magento-2

An Adobe Commerce developer is tasked with adding an new export option for the order grid, they have added the following code for the export button within sales_order_grid.xml:

Upon testing, they are getting redirected, what would be a cause for this error?

A.
The option's uri attribute is not valid.
A.
The option's uri attribute is not valid.
Answers
B.
The layout cache needs to be refreshed.
B.
The layout cache needs to be refreshed.
Answers
C.
The developer has to add a formkey for the new export option.
C.
The developer has to add a formkey for the new export option.
Answers
Suggested answer: C

Explanation:

The developer has to add a formkey for the new export option because the formkey is required for security reasons. Without the formkey, the request will be rejected and redirected to the dashboard page. Verified

Reference: [Magento 2.4 User Guide] [Magento 2.4 DevDocs]

An Adobe Commerce developer is tasked to add a file field to a custom form in the administration panel, the field must accept only .PDF files with size less or equal than 2 MB. So far the developer has added the following code within the form component xml file, inside the fieldset node:

How would the developer implement the validations?

A)

Add the Validations Within the HyVendor\MyModule\Controller\Adminhtml\CustomEntity\UploadPdf Controller

B)

Add a virtual type forMyvendor\MyModuie\Modei\customPdfupioader specifying the aiiowedExtensions and the maxFiiesize for the constructor, within the module's di.xmi:

C)

Add the following code inside the<settings> node:

A.
Option A
A.
Option A
Answers
B.
Option B
B.
Option B
Answers
C.
Option C
C.
Option C
Answers
Suggested answer: B

Explanation:

The developer can add a virtual type for Myvendor\MyModuie\Modei\customPdfupioader specifying the aiiowedExtensions and the maxFiiesize for the constructor, within the module's di.xmi. This way, the developer can reuse the existing file uploader class and customize it for the specific field without modifying the core code. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

An Adobe Commerce developer wants to generate a list of products using ProductRepositorylnterf ace and search for products using a supplier_id filter for data that is stored in a standalone table (i.e., not in an EAV attribute).

Keeping maintainability in mind, how can the developer add the supplier ID to the search?

A.
Write a before plugin on \Hagento\catalogVtodel\ProductRepository: :geti_ist() and register the search criteria passed. Write an event observer to 0 listen for the event cataiog_product_coiiection_ioad_before. Iterate through the registered search criteria, and if found, apply the needed join and filter to the events scollection.
A.
Write a before plugin on \Hagento\catalogVtodel\ProductRepository: :geti_ist() and register the search criteria passed. Write an event observer to 0 listen for the event cataiog_product_coiiection_ioad_before. Iterate through the registered search criteria, and if found, apply the needed join and filter to the events scollection.
Answers
B.
Add a CUStOm filter to the Virtual type 'agento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ProductFilterProce5sor for supplier_id field. In the custom filter, apply the needed join and filter to the passed $collection.
B.
Add a CUStOm filter to the Virtual type 'agento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ProductFilterProce5sor for supplier_id field. In the custom filter, apply the needed join and filter to the passed $collection.
Answers
C.
Write a before plugin On \Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface: :process(). Iterate through the $searchCriteria provided for supplier_id, and if found, apply the needed join and filter to the passed scollection.
C.
Write a before plugin On \Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface: :process(). Iterate through the $searchCriteria provided for supplier_id, and if found, apply the needed join and filter to the passed scollection.
Answers
Suggested answer: B

Explanation:

The developer can add a custom filter to the virtual type Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ProductFilterProce5sor for supplier_id field. In the custom filter, the developer can apply the needed join and filter to the passed $collection. This is the recommended way to extend the search criteria for products using dependency injection and plugins. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

When researching some issues with the indexer, an Adobe Commerce developer is seeing errors in the logs similar to Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. It is suggested that the client update innodb_buf f er_pool_size or decrease the batch size value.

Why does decreasing the batch size value improve performance?

A.
This decreases memory usage for the temporary table.
A.
This decreases memory usage for the temporary table.
Answers
B.
This allows for a longer timeout per batch process.
B.
This allows for a longer timeout per batch process.
Answers
C.
This allows for more PHP threads to be utilized during the process.
C.
This allows for more PHP threads to be utilized during the process.
Answers
Suggested answer: A

Explanation:

Decreasing the batch size value improves performance by reducing the memory usage for the temporary table. The batch size value determines how many rows of data are processed at a time by the indexer. A large batch size value can cause the allocated memory size for the temporary table to exceed 20% of innodb_buffer_pool_size, which can result in errors and slow down the indexing process. By lowering the batch size value, the indexer can process the data more efficiently and avoid memory issues. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

An international merchant is complaining that changes are taking too long to be reflected on the frontend after a full product import.

Thinking it may be database issues, the Adobe Commerce developer collects the following entity counts:

* Categories: 900

* Products: 300k

* Customers: 700k

* Customer groups : 106

* Orders: 1600k

* Invoices: 500k

* Creditmemos: 50k

* Websites : 15

* Stores : 45

What is a probable cause for this?

A.
The combination of the number of products, categories and stores is too big. This leads to a huge amount of values being stored in the flat catalog indexes which are too large to be processed at a normal speed.
A.
The combination of the number of products, categories and stores is too big. This leads to a huge amount of values being stored in the flat catalog indexes which are too large to be processed at a normal speed.
Answers
B.
The combination of the number of orders, customers, invoices and creditmemos is too big. This leads to a huge amount of values being stored in the customer grid index which is too large to be processed at a normal speed.
B.
The combination of the number of orders, customers, invoices and creditmemos is too big. This leads to a huge amount of values being stored in the customer grid index which is too large to be processed at a normal speed.
Answers
C.
The combination of the number of products, customer groups and websites is too big. This leads to a huge amount of values being stored in the price index which is too large to be processed at a normal speed.
C.
The combination of the number of products, customer groups and websites is too big. This leads to a huge amount of values being stored in the price index which is too large to be processed at a normal speed.
Answers
Suggested answer: C

Explanation:

The probable cause for the delay in reflecting the changes on the frontend after a full product import is the combination of the number of products, customer groups and websites. This leads to a huge amount of values being stored in the price index which is too large to be processed at a normal speed. The price index calculates the final price of each product for each customer group and website, taking into account various factors such as tax, discounts, catalog price rules, etc. When there are many products, customer groups and websites, the price index becomes very complex and time-consuming to update. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

When checking the cron logs, an Adobe Commerce developer sees that the following job occurs daily: main.INFO: Cron Dob inventory_cleanup_reservations is successfully finished. However, the inventory_reservation table in the database is not emptied. Why are there records remaining in the inventory_reservation table?

A.
Only reservations matching canceled orders are removed by the cron job.
A.
Only reservations matching canceled orders are removed by the cron job.
Answers
B.
Only reservations no longer needed are removed by the cron job.
B.
Only reservations no longer needed are removed by the cron job.
Answers
C.
The 'Auto Cleanup' feature from Multi Source Inventory was disabled in configuration.
C.
The 'Auto Cleanup' feature from Multi Source Inventory was disabled in configuration.
Answers
Suggested answer: B

Explanation:

The reason why there are records remaining in the inventory_reservation table is that only reservations no longer needed are removed by the cron job. The inventory_reservation table tracks the quantity of each product in each order and creates a reservation for each product when an order is placed, shipped, cancelled or refunded. The initial reservation has a negative quantity value and the subsequent reservations have positive values. When the order is complete, the sum of all reservations for the product is zero. The cron job removes only those reservations that have a zero sum from the table, leaving behind any reservations that are still needed for incomplete orders. Verified

Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]

Total 69 questions
Go to page: of 7