To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #396 (closed defect: fixed)

Opened 21 months ago

Last modified 19 months ago

Adding categories doesn't work from the sidebar

Reported by: agilbert Owned by: rickybanister
Priority: critical Milestone: 1.4.1
Component: apostropheBlogPlugin Version: 1.4
Keywords: Cc: johnnyoffline, boutell, rickybanister, pgodel
Symfony version: 1.4

Description (last modified by agilbert) (diff)

(This is on the latest checkout of the 1.4 branch of asandbox.)

Following these steps:

  1. Create a new blog post or edit an existing one
  2. Click the "Choose Categories" dropdown
  3. Choose the "+ New Category" option
  4. Add a category name
  5. Press "return"

I got this:


I went the same steps again, but instead of pressing return I clicked the "+ Add" button. Seems to have worked this time...

But then I refreshed. Now the category I just added doesn't exist on the post or even as an option in the dropdown.

The only way I was able to add categories to my posts was by first going to the "Edit categories" page.

Attachments

Screen shot 2010-05-26 at 11.46.26 AM.png Download (20.1 KB) - added by anonymous 21 months ago.

Change History

Changed 21 months ago by anonymous

Changed 21 months ago by agilbert

  • description modified (diff)

Changed 21 months ago by agilbert

  • description modified (diff)

Changed 21 months ago by dordille

  • owner changed from dordille to johnnyoffline
  • status changed from new to assigned

I addressed part of this, saving new categories works however the enter button can not be used. John can you address this.

Changed 19 months ago by johnnyoffline

  • owner changed from johnnyoffline to rickybanister

Rick, can you update your 1.4 sandbox and confirm that this is working then close this ticket?

Thanks

--

Just had to expand upon Tom's multiselect JS to get this going

			container.find('.add-add').click(function() {
				doSaveAdd();
			});
			container.find('.add-text').keypress(function(event){
				if (event.keyCode == '13') {
					event.preventDefault(); 									
					doSaveAdd();					
				};
			});
			function doSaveAdd()
			{
				container.find('.add').hide();
				var addText = container.find('.add-text');
				var v = addText.val();
				addText.val('');
				var ev = aHtmlEscape(v);
				if (v.length && (!containsLabel(v)))
				{
					container.append("<input type='checkbox' name='" + addName + "' value='" + ev + "' style='display: none' checked />"); 
					var remover = $(liHtml(v, options));
					remover.click(function() {
						// Must use filter, can't have nasty characters in a selector
						container.find('input[type=checkbox]').filter(function() { $(this).val() === ev }).remove();
						$(this).remove();
						onChange();
						return false;
					});
					container.find('ul').append(remover);
					remover.show();
					onChange();
				}
				return false;				
			}

Changed 19 months ago by rickybanister

  • status changed from assigned to closed
  • resolution set to fixed

confirmed, this works.

Note: See TracTickets for help on using tickets.