How to find where to put a breakpoint in Magento2? - magento2

I have a task to locate why products are not shown to a non-logged customer after admin makes it.
The fix is that if you re-index and clean cache the customer will see the new product or the second solution is to go to shared products, enter product categories and just save.
Now the problem is I want to put a break point on that "save" button so I can see what goes on after that but I don't know how to find it in my project.
Is there a simple way to know what code is your magento2 using on that given page/button or whatever.

If you are a person with a deep understanding of Magento then you can easily guess that clicking the "Save" button will call a controller to perform the data retrieval and save data.
In your case when saving it will go to file:
vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php
During the save process Magento will reindex the product you have saved. You need to put a breakpoint in the file I provided and find out why

Related

Adding buttons to a FileMaker portal to jump to the related records

I've just started in FM 14. I have a client table and a project table. When I look at a client entry I have a portal that shows me the titles of the projects they have commissioned. I'd like to be able to click on one of the projects in that portal list and be taken to the layout that contains all of the other fields in that project record. Can this be done? Is this enough information?
Yes. Set the button action as a script step "Go to Related Record". In this script step, set the table as "projects" and select the layout you would like to go.
I would stay away from GoToRelatedRecord. I usually just grab the ID from the item in the portal, then search for that item on a new layout, then do whatever I planned on doing. It's safer. With GoToRelatedRecord you can never really control what happens.

is it possible to show contact number of current logged in user when artifact is created in tuleap

We are using the Tuleap 7.0 for Project management. We have a new requirement that we need to show the contact number of current logged in user when a artifact is submitted either in a separate field or in the same field (submitted by). Is it possible to show or what type of code change has to be done, to retrieve the current logged in user information when artifact is created. Kindly do needful.
That's not easy. There are two main steps: one surrounding the user; the other surrounding the artifact.
First you would need to edit PFUser.class.php to add the property to the user object. You would also probably need to create a forgeupgrade script (database upgrade) so that you could save and modify the property. Obviously the UI and scripts that manage the CRUD of a user would also need changing.
Next, you would need to create a new type of class that extends TrackerformElementField, make that type available for use in the Tracker Field administration and set its value to the user's contact number.
Unfortunately, any of these modifications, if not done carefully, can have important side-effects. If you want to write your code and have it reviewed by the community, you can go through gerrit.tuleap.net and read the developer guide

Play Framework form with history

I'm working on an application using Play 2.0.4 in Scala, and one of the features I was asked to implement is to build a form that remembers all of the edit history. Basically, there should be a button next to every field that shows the details of every change, because the app users may want to rollback or use the edit history information later.
The first idea pops up in my mind is to assign a hidden div to every field that appends every change, and only shows the div when users click on the corresponding button. This doesn't sound very hard, but I feel like it may make the HTML a mess (since each user has his own record, each record has many fields). Or I could make a copy of the database and store all the changes inside, with the primary keys changed to be both the id of the form, and the edit time.
Thoughts? Am I overthinking the problem? Is there a more elegant way to store all of the edit history? We estimate that there would only be around 200 people in the company using it, so I guess I can let efficiency slide a little...
Thanks in advance.
I would normalize and persist the record in the database. This would allow you to have history on changes by having a history table for each section that they with to rollback.
This would allow manageability of restorations based on sets of data and significant changes can be tracked. Managing each field separately would be very cumbersome and least pragmatic.

Updating model behind the editor when file has been refreshed

I am writing multi-tab editor for Eclipse. This plug-in has several tabs and the last one is the text source - something similar to the plugin.xml editor in PDE.
There is some model behind it which is used to show some information in tabs which are base on the data in the text source. User may edit source and when he/she switches to another tab the model is updated. That works fine.
The problem is when someone edits source file in an external editor. Then refresh project and the model should be also refreshed. But how can I achieve this?
I tried to use addResourceChangeListener, it notifies my with pre-refresh events, but it doesn't contain information if my file is going to be updated (e.g. only project resource if someone tried to refresh the whole project).
Other idea I had was to add document listener when a pre-refresh event comes and to remove it in the post-change handler. However here the problem is that if file hasn't changed and hasn't been updated no post-change event is sent, so I stay with unnecessary document listener which will be informed about all edits done by user in the last (source) tab.
I will appreciate any help.
A Refresh, when it finds changed files, will report them as having been changed. You probably mean to listen to the POST_CHANGE notification as shown at http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html .

Stop form from open when no records

I have a data entry form that when it closes opens another form for further updating the just newly entered data. However, at times no further update is necessary. How can I suppress the 2nd form from opening when there is no need for further update? Presently the form opens even when there are no recordsets present. (need a similar Event like for the report "On No Data")
Have a bit field such as a checkbox with default set to true open second form. Uncheck it to avoid the system from opening the next form. You will need to handle this in your code and check if that check box is checked or not.
Of course we will need more details such as why you are currently opening this second form...in addition, cant you check if any changes were made and if they were then open that second form else dont? Also what lang ?
Without knowing more about what you're working on, I'd say you would have to modify the process that shuts down the first form to check if the second form is needed. In .NET, for example, you could add code to the OnClosing event for a WinForm to check. If it's needed, open it as normal, if not then don't.
Subject: Tool Kits. Tool Kits consist of 1 or more tools. If tools already exist, no need for 2nd form to pop up. If tools are new, I need to fill in one of the 3 fields in the drop down listing. I like the idea of adding code to the OnClosing event, but do not understand what you mean by WinForm.