Sample Component with Content Versioning from Joomla Site not working correctly - version-control

I was trying to restore a version of a content I am editing.
in my administrator/components/com_joomprosubs/tables/subscription.php
in the construct function I added this following line:
JObserverMapper::addObserverClassToClass('JTableObserverContenthistory',
'JoomprosubsTableSubscription', array('typeAlias' =>'com_joomprosubs.subscription'));
from what I have read in this link:
https://docs.joomla.org/Using_Content_History_in_your_Component
but when I try to restore a version, an error is displayed:
"Error restoring item version from history."
I have followed the procedures step by step from that link. The storing of content history works, the only problem is when I try to restore the older versions. I even downloaded the finished sample file on the link's above.
The error is being return due to the blank value of typeAlias. I don't know where I got it wrong. from the code that I added above, I have included the typeAlias with its corresponding value. The weird thing is, if my code above does not work, it would not been also able to store content history.
Has anybody tried adding versioning in their custom component in Joomla? Please leave your comments.

For now, I temporarily overridden the loadHistory function from the Base Class.
from there, i passed the alias as 'com_joomprosubs.subscription'. The restoring of version history is now working.
Is there a disadvantage in my resolution?

Related

Error in Moodle Missing required parameter (id)

In one of the courses, an error occurs when trying to create a backup copy of the test: "Missing required parameter (id)".
The test was previously ported from moodle 1.9.9 to moodle version 3.11.6 and works great.
Why then it is not copied? What parameter is missing?
I turned on debug mode and error output, but I didn't see anything on the page.
I looked in the logs, but found nothing there (little experience).
I cleared all site caches through the Administration section.
Is the debug level set to developer?
I can't see "Missing required parameter" as a language string in the core moodle code - is that the exact string?
If it isn't the exact string, can you update the question with the exact string.
If it is the exact string, then it might be a contributed / custom plugin
When you backup the course, in the backup settings, try selecting 1 activity/module at a time until the error occurs. Then you know which activity is displaying the error - can you update the question with the activity type/plugin name.

KsqlRestClient.makeKsqlRequest("RUN SCRIPT ...") doesn't work without filling ksql.schema.file.content with the script content yourself

In my Scala application, I am trying to tell my KSQL Server that it should execute the RUN SCRIPT <script> command, using the KsqlRestClient.makeKsqlRequest(String ksql) function. Every time I tried it, nothing happened, even though the response was successful, so I started debugging, where I saw that the response was a success but it also returned some kind of error that the property ksql.schema.file.content was empty.
Since I did not find any documentation as to what to fill this property with, I tried some things and eventually found out that if you fill this property with the contents of your .sql file, the run script command works.
Does anybody know if and with what ksql.schema.file.content should normally be filled and/or if the way I am using it is how your supposed to execute a script in KSQL from a Scala application. I already copy and pasted the text from the makeKsqlRequest into the KSQL CLI and everything worked fine, so there should be no error with that.
There is a Github issue tracking the fact that the RESTful API is not documented / supported yet, (as of March 2018).
It sounds like this is something you may want to add a +1 too.

Unable to delete content resources on JasperReports Server

I'm using JasperReports Server 5.6 and I have some reports deployed there.
The problem starts when I generate a PDF output for my reports. I can see the output file in the repository, but I'm unable to delete it.
I'm able to delete other types of resources, as an image or report, for example. But when I need to delete a generated PDF, the upper options bar doesn't offer me any options (including deleting). If I try to right-click the PDF, it doesn't open any pop-up menus (as it does for images, for example).
The image below shows what happens to the options bar:
Here goes some interesting things I've noticed:
The type column in the repo tells me the PDF is a "Content Resource". If I manually upload another PDF from my local machine to the repo as a "Content Resource", the UI also doesn't let me delete the resource.
I'm logged in as the administrator user. It's set with ROLE_USER and ROLE_ADMINISTRATOR roles (it's the default jasperadmin user).
The directory which contains the PDF is set with permissions Read+Write+Delete for the ROLE_USER.
Tried to log in as another user with ROLE_USER and I got the same result.
The JasperReports Server's tomcat is running as root (it's a test environment).
I went through the JasperReports Server's User's Guide and Administrator's Guide. Both said that I need to have the right permissions (and I do), and also I need to have no references to the resources to be deleted. In the case above, where I have an uploaded PDF as a "Content Resource", I don't have any references to it inside the repo, and I still can't delete it!
If I delete the super directory that contains the PDF, it works fine.
So, do you guys have any ideas of what I can try to get rid of these PDF outputs?
So far the best solution, I didn't find any better, for this is to use the delete button on the keyboard
I really don't know why is the menu button disabled but nevermind.
I am facing the same problem. There is a work around for this: Use Jaspersoft Studio.
Add a JasperReports Server Connection, expand the node and locate the file you wanted, then right-click and select Delete.
This is not an elegance solution but works for the moment.
EDIT - found the problem and have a fix.
The JS is missing "Utils" scope in getInitConfiguration. The original source is:
var Utils = {
restOfString: function(str, fromStr) {
var from = str.lastIndexOf(fromStr) + fromStr.length;
return str.substring(from, str.length).trim();
},
getInitOptions: function () {
return localContext.rsInitOptions || __jrsConfigs__.repositorySearch["localContext"].rsInitOptions;
},
getInitConfiguration: function () {
return getInitOptions().configuration;
}
};
Just change "return getInitOptions().configuration;" to get "return Utils.getInitOptions().configuration;"
You'll have to make this change in the optimized version of the script (optimized-scripts/results.page.js). Fortunately there are only two occurrences of getInitOptions so it's easy to find and fix the correct one.
The root cause is a javascript error:
uncaught ReferenceError: getInitOptions is not defined
This is coming from results.page.js, but I haven't found a fix for it yet. This code is attempting to change the state of the toolbar buttons. I tried using the latest 6.x version of the script, and that did not fix the problem either.
Also listed at http://community.jaspersoft.com/questions/843951/unable-delete-report-output-jasperserver-56
When you are going to delete the content resource Delete button show disable. I am also experiencing the same problem so for time being I am deleting my content resources by using following query on Jasperserver schema.
Delete from jicontentresource where id in
(
Select id from jiresource
where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25');
Delete from jiresource where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25';
You have only to mark all files and then push the Delete-Button

Error updating service reference

When trying to update a service reference in a class library (VS2013), i get the following error.
"The configuration for the service reference could not be updated due to the following issue: An error occurred creating the configuration section handler for system.serviceModel/bindings: AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only."
This same error happens when i try to delete the reference as well.
Any help in sorting would be greatly appreciated.
I've had the same issue after updating to VS2013 Update 2.
I've solved the issue by temporarily cutting the whole system.serviceModel section out of web.config, pasting it somewhere else like Notepad. Then, I've saved the web.config without the service model section. Then, I was able to update the service reference successfully. After updating the service reference, I've pasted the service model section back to web.config and it worked successfully.
I was able to work around this similarly to Can by temporarily removing the extensions element of the system.serviceModel section and any associated extension elements. In my case the extensions were Azure Service Bus extensions.
In my experience it has been as simple as to delete the service reference and re-adding it. For example, last time it happened it was on a WebService (not WCF, the old one), and the error started appearing after we changed one of the classes that was being sent as a return from different routines/functions. After adding one more property to the class, it started going crazy and prompting errors everywhere.
Just a simple Delete and re-Add Service Reference did the trick.
Only need to one time remove <system.serviceModel> section from web.config. After Create first service refrence , this section rebuild by Vs.

How can I get rid of a persistent VBA Form Object that won't honor the form deletion?

I have an MS Access 2003 database that I'm using to develop a basic little inventory app. I have added some extraneous forms along the way and I wanted to get them out of the DB. I deleted most of them just fine but one of them appears to have left behind its VBA Object. All that's in the object is Option Compare Database. Now whenever I try to work with the database, I get the following error:
The form name 'Transaction1' is misspelled or refers to a form that doesn't exist.
If the invalid form name is a macro, ...
Truncated for typings sake.
Yes, I agree, the form doesn't exist. What confuses me so much is that all of the other forms, when I deleted them, also destroyed their VBA object as well. This one, no matter what, seems to like to stick around and I have no idea how to get rid of it.
How do I get rid of it?
Things I've tried:
Compact and Repair and the DB
Create a new form named what it's expecting, verify that it gets rid of the problem, and then delete that form.
You can try the /decompile switch
Make a backup of your mdb
Open your mdb (hold the SHIFT key down to stop any code from running) via a short
cut: msaccess.exe database.mdb /decompile
Open a module and compile your app
Save and close Access
Open again (SHIFT again) without decompile
Compact and repair database
close Access
I had similar problem. I found I had named the missing form in the STARTUP menu as the default form to open when starting Access. I opened Tools>Startup and deleted the missing forms name from the "Display/Form/Page" field of the Startup. My problem solved.
The problem I was having is that the form was named ~TMPCLP8151 and would not show up in Access no matter what I tried, but I could see it in VBA in the Project Explorer. Here's how I resolved the issue. I created a new form, and created an Event Procedure for Form_Open that contained this:
DoCmd.DeleteObject acForm, "~TMPCLP8151"
Then I just opened the form, and sure enough, the VB code deleted the form that I could not delete myself.
I had a same problem. I created a form with same name and deleted the form again. That fixed the peoblem. Try. BTW try to open the new form in design mode to make sure if the VBA module is assosiated with the new form.
I had to combine both solutions to achieve the goal.
First de- and recompile
next compact and repair
then create new form with the same name and delete it
Pay attention that the form has the status Hasmodule set to Yes
I had this problem. I renamed my default form from Form Login to frmLogin which suits my naming style, but the program was still looking for it on opening. I am using 2013 so I went to File » Options » CurrentDB and in the display dropdown select the new name. The old name remains in the list until you close and restart the application.